19

We have our website running on two machines with iis 7.5 One works fine.

The other one how ever takes a really long time to process the first request after an app-pool recycle. It can take upwards of 60secs which is unacceptible since its going to be used as our production server.

I've checked the app-pool settings on the both servers and they are the same, and the webapp version on both servers is the same. I've run the task manager and resource monitor, add see a connection to the machine when I make the request but nothing else happens, iis doesn't even show the request in the logs untill its completed. I don't really know what its doing in the mean time.

Are there any traces of settings we can try to play with to fix this or find the problem. It's very puzzling.

EDIT: So I've got some more information now, finall got the failed request logs to work (had to give the user IIS_IUSRS permissions) but I've got some logs to see whats going on

The time lost is inbetween two seconds in the log file.

1. MODULE_PRECONDITION_NOT_MATCH    Name="ScriptModule-4.0", Precondition="managedHandler,runtimeVersionv4.0"            12:09:46.422 
2. VIRTUAL_MODULE_UNRESOLVED        Name="FormsAuthentication", Type="System.Web.Security.FormsAuthenticationModule"     12:12:04.390 

As you can see it takes over 2 minutes inbetween those two events, anyone encounted this before?

4

1 回答 1

22

这有点难以判断您的其他服务器上发生了什么,但是这里有一个您可能需要重新考虑的简单清单:

  • 始终预编译您的网站,而不是复制它!在部署之前编译您的网站可能会获得显着的性能提升: ASP.NET 预编译概述

  • 不要在debug="true"启用的情况下运行生产应用程序,当 web.config 中的调试标志为真时,运行时应用程序中会使用更多内存,并且由于启用了一些额外的调试路径,代码执行速度会慢得多

  • 检查您的 Web.config 文件以确保在该<trace>部分中禁用跟踪

  • IIS 7.5 带有自动启动功能。WAS(Windows Process Activation Service)启动所有配置为自动启动的应用程序池,确保您的应用程序池配置为AlwaysRunning在 IIS 7.5applicationHost.config中,查看此处了解更多详细信息

  • 检查ASPNET.CONFIG文件以查看两台服务器上的配置是否仍然相同。每个 asp.net 服务器都可以通过aspnet.config位于框架文件夹根目录中的文件很好地配置

  • 确保在您的 aspnet.config 文件中将代码访问安全性 (CAS) 的发布者证据设置为 false,这可能会在您重新启动 ASP.NET 应用程序池时增加初始页面加载。你可以在这里阅读更多关于它的信息

以下是禁用检查应用程序的 CAS 发布者策略的方法:

<configuration>
    <runtime>
        <generatePublisherEvidence enabled="false"/>
    </runtime>
</configuration>
于 2012-12-17T17:46:18.650 回答