First server call is taking more time than subsequent call in Windows Azure cloud application? -


I am working on Windows Blue Cloud Service The first time I click the login button, it takes 6 to 7 seconds, but after some time when I click on the same login button, it takes 2 seconds. I can not understand why this is happening, although the server side code is the same for both processing, but later calls are faster than the first call.

"first hit" delay is very common with ASP.NET applications, overhead of JIT compilation, and Various "pools" (database connections, threads, etc.) can not be started. If you have an ASP.NET Web form application, then each .aspx page is compiled for the first time, when it is used, not when the server starts. Apart from this, various caching mechanisms (server or client) that make subsequent requests faster, are not started on that first hit and on any first hit, any code will be run in application_start, setting up routing table and any other start Have to do.

There are many things that you can do to prevent your users from seeing this delay. The simplest is to write any type of automated process that hits every page and runs it after deploying a new release, there are also modules for IIS, which will execute code next to application-start when the site is actually deployed. . To find those people

You may experience delays even after the duration of inactivity, if your ASP.Net App Pool is recycled - it resets a group of things and causes the start-up code Next request You can improve this effect by setting some to ping a page on your site so that if the App Pool is recycled then it will be re-warmed instead of the next real user request Programming is. The uptime monitoring service will be used for this, or for Scheduled Tasks within the Azure Ecosystem.


Comments