37
votes

I've been investigating a slow warmup time for my production app and I got some unexpected results.

Testing on various Azure VMs showed the warmup time to be well-related to the application server performance (so it's not external request, including sql), but what's really interesting is the comparison to Azure Web Apps and my own local machine (all times are averages from at about 3 runs):

VM A0:            >1m
VM A2:            13s
VM D2V2:           6.8s
VM D5V2:           7.8s
Wep App P2:       25s
Web App S2:       26.5s
My local machine:  6.6s

My local machine is an i5 with 3.3GHz.

The local machine is fastest even though it connects to the same SQL Azure database over the internet and the request includes Entity Frameworks's model checking.

All tests use .NET 4.6.1, the newest release at this time.

Apparent conclusion:

  • My 4 year old desktop box is faster than any size of Azure VM for jobs that are not parallelizable.
  • Azure Web Apps run on potatoes even if you're willing to spend 500 bucks a month.

This seems fishy. Any ideas what else might be going on? Or what to test?

EDIT after some profiling: None of the following sheds any light on my question, but it's still interesting information (tested on another A2 VM with 20s total request time while the profiler being attached):

  • 58% is jitting.
  • File IO blocking is virtually zero (the app has been started before, so I guess all required dll parts are in the memory cache).
  • <1% is SQL Azure requests.
  • The rest of the 90% running time should therefore be .NET execution or profiler overhead.
  • The profiler itself has quite the overhead, as the request runs in about only 15s without it (I used a trial of JetBrains dotTrace, which I really like)
  • 50% of the time is during the first request with Entity Framework, 80% of it being jitting
  • 15% being the first use of SignalR, almost no jitting (doing some reflection-nonsense)

Almost no parallelization is being done.

2
Not helpful to the OP, but I found myself here searching for why my azure webapp seemed so slow, and it transpired my web-app was being hosted in a different location to my database/caching/blobs/etc...James
The new Dv2 machines are much faster, but are only support on the over-expensive Premium tier. See feature request feedback.azure.com/forums/169385-web-apps/suggestions/…Dave New
@John Yes, Premium v2 went into general availability end of 2017. We are experiencing just over 2x performance improvements on our CPU-intensive workloads. A-series to Dv2 is a big jump.Dave New
@John are you sure you have configured it as a Dv2 instance? The premium tier offers both.Dave New
@davenewza Got it now, they are indeed twice as fast. Thanks.John

2 Answers

5
votes

Initially when we deployed our Azure App Service - Web app (hosted in Resource Group1) and our Azure SQL database (hosted in Resource Group2), the app was very slow. The mistake that I made was that both the RG1 vand RG2 were in two different locations. Later, when we changed the location of both RGs (recreated them actually) to be the same then the WebApps started running smooth.

Thanks, Prawin

1
votes

I too have the same problem, I fixed by moving or copying my site contents(Pictures and Videos) to Azure Blob Storage. We can also configure Azure CDN to WebApps, VM, Cloud Services and Custom origin. By trying thsi Azure CDN your site loading time will improve.