How do I prevent IIS from compiling website?

前端 未结 5 1037
北荒
北荒 2021-02-08 10:46

I have an ASP .NET web application which on the backend is talking to an ASMX web service. We have counted and the average wait time for the initial request is 20s. I am wonderi

相关标签:
5条回答
  • 2021-02-08 11:27

    One alternative approach is to write a "warm-up script" which simply executes one page from your app. This will make the server spin-up for you and the next person will get a fast hit. You could also set a scheduled process to run that script occasionally (like, if you schedule the thread pool to recycle at 4 am, schedule the warm-up script to run at 4:01 am)

    0 讨论(0)
  • 2021-02-08 11:34

    Have you tried using aspnet_compiler in the framework folder (e.g. %SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727)?

    You can control ASP.NET recycling via the settings on the Application Pool. If it is recycling more often than the settings then something else is causing that (e.g. changes to the web.config etc.)

    0 讨论(0)
  • 2021-02-08 11:36

    At a previous position we had similar issues with WCF services when initially spooling up we bypassed this by creating a simple program that would invoke all our web services after a deployment.

    You could also use this same type of program as a keep alive service and just ping the services every 5-10 minutes etc.

    0 讨论(0)
  • 2021-02-08 11:43

    Try to disable application recyling in the configuration of the page or application pool in the IIS.

    IIS 6 (If i remember correctly): Rightclick on AppPool -> Tab "Performance" -> Uncheck "Shut down working process on idle time"

    IIS 7.5 There is property (seems to be an appPool settings too) that shuts down the AppPool after X minutes of idling time. The value 0 is equal to "never shut down"

    Hope this helps

    0 讨论(0)
  • 2021-02-08 11:44

    You should be looking to perform precompliation as part of your build/deploy scripts.

    Having a post-deployment activity to programatically request each web resource and trigger compliation seems pretty daft to me.

    Thomas' answer gives the compiler, there's also a guide over at the MSDN, How to: Precompile ASP.NET Web Sites.

    If you're using MSBuild then go for the AspNetCompiler Task.

    (I probably would have made this a comment but I'm not yet allowed... not enough SO juice)

    0 讨论(0)
提交回复
热议问题