title: Azure Web Apps are really slow
body: <p>I've been investigating a slow warmup time for my production app and I got some unexpected results.</p>
  
  <p>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):</p>
  
  <pre><code>VM A0:            &gt;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
  </code></pre>
  
  <p>My local machine is an i5 with 3.3GHz.</p>
  
  <p>The local machine is fastest <em>even though it connects to the same SQL Azure database over the internet and the request includes Entity Frameworks's model checking</em>.</p>
  
  <p>All tests use .NET 4.6.1, the newest release at this time.</p>
  
  <p>Apparent conclusion:</p>
  
  <ul>
  <li>My 4 year old desktop box is faster than any size of Azure VM for jobs that are not parallelizable.</li>
  <li>Azure Web Apps run on potatoes even if you're willing to spend 500 bucks a month.</li>
  </ul>
  
  <p>This seems fishy. Any ideas what else might be going on? Or what to test?</p>
  
  <p><strong>EDIT after some profiling:</strong> 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):</p>
  
  <ul>
  <li>58% is jitting.</li>
  <li>File IO blocking is virtually zero (the app has been started before, so I guess all required dll parts are in the memory cache).</li>
  <li>&lt;1% is SQL Azure requests.</li>
  <li>The rest of the 90% running time should therefore be .NET execution or profiler overhead.</li>
  <li>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)</li>
  <li>50% of the time is during the first request with Entity Framework, 80% of it being jitting</li>
  <li>15% being the first use of SignalR, almost no jitting (doing some reflection-nonsense)</li>
  </ul>
  
  <p>Almost no parallelization is being done.</p>