Wednesday, March 21, 2012

AJAX Slow Startup Time for First Request

Hi,

After quite a bit of hunting around posts I'm stuggling to find any issues that seem to match our performance issues that appear to only target startup and not actual application performance.

We have a Web Application Project (Visual Studio 2005 SP1) using AJAX that is deployed onto IIS 6 and each time after the worker process is recycled the first request is taking (on average) 20 seconds to complete. Each additional request thereafter is completing in under 2 seconds.

All of the assemblies deployed onto the server are release build assemblies and the debug option within the web.config file is set to true. We are not seeing any issues with the time or amount of data being transferred to the client browser after the first request.

After some extra digging we have discovered that without any reference to System.Web.Extensions within the web.config (effectively removing AJAX from the application) the first request after the worker process is recycled is completing within 3 seconds. And, subsequently adding in the appropriate AJAX references causing the first request to return to taking 20 seconds to complete.

What does adding the System.Web.Extensions references into the Web.Config cause ASP.Net to do on startup? I'm more than happy to accept that there is going to be some additional cost, however, an additonal 15-17 seconds is a large leap.

Is there anything that we can do to minimise this lengthy startup time?

Thanks in advance of any assistance.

With ASP.Net, the first request will always take longer. There is the overhead of JIT compiling for the requested app. One of the ways you can cut this down is to use pre-compilation for your website.

If you are releasing 'release' versions of your dlls, you shouldn't need debug set to true. Setting this to false could also help with speed.


I have the same problem.

AJAX.NET take sometime to load and also Infragistics WebGrid takes about 15 seconds to load.


I understand that there will always be an overhead for a first request.

My concern isn't an ASP.Net problem, but rather an AJAX problem. Our application without any AJAX functionality is able to comlete it's first request in under 3 seconds, however, as soon as we attempt to include AJAX into the application (with no other changes) the first request is now taking 20 seconds to complete.


Regardless of any other application settings, the only one that seems to make it any slower is including the AJAX web.config settings.


We are also facing same issue. Please do let me know if you have managed to resolve this issue.


So far the only workaround we have applied for this issue is to modify the IIS 6 application pool details to prevent the worker processes from recycling as often as they do by default. This is not a long term workaround, but has helped for us as we do not have any memory/performance issues with our application running over long periods of time.


I'll be sure to post here again if we do discover an appropriate solution.


I'll try to set the IIS 6 Application Pool as you wrote.

Thanks!


Hi, we are still trying to solve this problem with the System.Web.Extensions assembly.

We made severals tests and finally today we noticed one thing. We have set up a virtual machine with a clean Windows 2k3 installation, IIS, ASP.NET 2.0 and AJAX Extension.

We found that if this virtual machine is not connected to the network, the assembly load in less than a second, but when we have connected it to the network the startup time was around 20 seconds.

Can anybody test this?

Does anybody have some ideas about how to solve this problem?

Thanks.


After a bit of testing we found a work around for this problem

We installed on our virtual machine a network sniffer and an empty WebSite with only the reference to System.Web.Extensions assembly.

We noticed that during the startup, our machine was trying to connect to the IP address (131.107.115.28) responding to crl.microsoft.com.

We added this line to our hosts file (C:\Windows\System32\Drivers\etc\):

127.0.0.1 crl.microsoft.com

and restart IIS.

Well, our application now takes less than 2 seconds to startup.

Hope you'll find this helpful!Cool


What the hell was it doing that for? Bill? You got some explaining to do!


Dbdj:

After a bit of testing we found a work around for this problem

We installed on our virtual machine a network sniffer and an empty WebSite with only the reference to System.Web.Extensions assembly.

We noticed that during the startup, our machine was trying to connect to the IP address (131.107.115.28) responding to crl.microsoft.com.

We added this line to our hosts file (C:\Windows\System32\Drivers\etc\):

127.0.0.1 crl.microsoft.com

and restart IIS.

Well, our application now takes less than 2 seconds to startup.

Hope you'll find this helpful!Cool

Has anyone else tried this? and did it help?


found this:

That is Microsoft's certificate authority server (CRL stands for "Certificate Revocation List"), which is used to verify whether the certificate for an application (or website) is legitimate or not. Microsoft applications have certificates associated with them and they can be check for validity at crl.microsoft.com.

Here's a relate thread:

http://www.wilderssecurity.com/showthread.php?t=15867

Here's a basic definition for CRL in general terms. You can search Google using "Certificate Revocation List" and find a lot more information.

http://encyclopedia.thefreedictionary.com/Certificate%20Revocation%20List

Now, you could try disabling the check in IE for "publisher's" certificate revocation, that is probably what's causing these particular connections. (IE > Tools menu > Internet Options... > Advanced tab > scroll down to Security section and look for "Check for publisher's certificate revocation" - is it checked?)


We tried to run our application with and without that option but there was no difference. So we decided to work on the "hosts" file.


After my ASP.NET website sits idle for more than 20 mins the next request is very slow. The reason is that the application domain is flushed from IIS and the application needs to be recompiled. I found this utility to be handy.http://www.spikesolutions.net/ViewSolution.aspx?ID=c2b7edc0-5de1-4064-a432-05f6eded3b82

No comments:

Post a Comment