Launching iis launch using aspx pages

Environment: Windows Server 2003; IIS 6, ASP.NET 2.0.50727

I'm going crazy about creating a new web server (note that this problem does not occur on our other web servers with the same configuration). When loading and asp.net application for the first time, the page hangs for a full minute before showing the page in the browser. After loading the first page, everything is very fast.

Note 1: You will probably say that the application was compiled for the first time. But I endured it. I add EVERYWHERE trace messages to the application, and all trace messages start within a second of the page request. Thus, the application compiles and starts immediately. But when the application finishes showing the page and my last trace message is printed, nothing will happen. IIS does something behind the scenes for a full minute before moving the completed page via http to the user's browser.

Note 2: We found that after getting the application for the first time and everything works fine, if we wait an hour, we will again get a delay. Thus, IIS has something in its cache that clears up after an hour and causes our site to stop again.

Note 3: Between each test we stop / start IIS to make it freeze when the application loads.

Note 4: We observed how the task manager sees IIS dive and process resources a lot. But that was not so. We saw a very fast surge of up to 50% just before the browser showed the page, but in the previous 60 seconds there was only 1% on the server.

Note 5: In another test, I created the HelloWorld.html page, and this does not cause IIS to freeze. So it has something to do with calling the ASP.NET library the first time it sends the displayed page via http. In addition, since the application is already compiled and executed instantly, it is simply a part of asp.net that sends the displayed page to the user's browser, which causes a delay.

Any ideas? We are a loss here. All our other web servers are configured the same and work fine, but this is a new installation. So, should a configuration parameter be set that was missed, or maybe something needs to be set?

Thanks,

Brian

+6
source share
3 answers

If you have access to the servers, make sure that the utilization of the application pool is actually registered in the event logs

cscript adsutil.vbs get w3svc / AppPools / DefaultAppPool / LogEventOnRecycle

you can configure it to record everything with cscript adsutil.vbs Install w3svc / AppPools / DefaultAppPool / LogEventOnRecycle 255

See here for more details.

Then check if there were any repetitions.

Initializing the application, creating a workflow, threads, loading the application domain and all the DLL links may take some time, which is normal, but this 1 minute delay is something else.

Try pre-compiling the application on the server and see if this helps aspnet_compiler -m / LM / W3SVC / [site ID] / Root / [your application]

If you want to dig deeper, you can check the ETW event trace.

  • logman query providers
  • Save the IIS / ASP.NET related Guides in a file, for example iisproviders.txt
  • logman start ExampleTrace -pf iisproviders.txt -ets -rt
  • play
  • LogParser "SELECT * FROM ExampleTrace" -i: ETW
  • logman stop ExampleTrace -ets

Here you can find more information. Troubleshooting appdomain reloads and other ETW tracing issues

I would also check w3wp.exe with procexp if it has TCP connection time or with Procmon for other tips.

If you have experience with windbg, you can make a request to the application and then quickly attach the debugger to the process

windbg -p [process id of the app pool] .loadby sos mscorwks g 

and from there from there. If there are exceptions, process crashes, etc., you should catch it ...

As soon as we had such a strange server problem like this, and reinstalling .NET solved the problem, I’m still not sure what was the culprit.

+1
source

There may be some aspnet.config settings in this field that are different from others. Have you tried to copy configuration files to this server? Apparently, there are certificate settings and registry changes that you can do to remove some delay time during the initial page load (pre-compose)

Look here and here

0
source

One thing you might want to check out is if access to the database is loaded on your page. This may block the creation of the page during the initial loading of the page. Then, when the request is cached (either using the db mechanism or another caching mechanism such as memcached), subsequent page loads work as usual.

According to your last comment,

I could stop / start IIS several times, and the application always started instantly. I thought this was fixed forever. But now I just tried again (it has been idle for the last couple of hours), and now it again hangs on the first request.

This may mean that the cache has expired, and therefore it needs to go back to the database, causing a page load delay.

0
source

Source: https://habr.com/ru/post/924205/


All Articles