IIS应用程序池回收很慢后7.5 Web应用程序首次请求 [英] IIS 7.5 web application first request after app-pool recycle very slow

查看:1242
本文介绍了IIS应用程序池回收很慢后7.5 Web应用程序首次请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有两台机器运行在IIS 7.5本公司网站
一个正常工作。

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

另一种怎么过需要很长的时间来处理一个应用程序池回收后的第一个请求。它可以采取的60secs向上这是unacceptible因为它要作为我们的生产服务器。

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.

我检查了两台服务器上的应用程序池的设置和他们是一样的,并且两个服务器上的web应用的版本是一样的。
我已经运行任务管理器和资源监视器,添加看到本机的连接时,我提出请求,但没有什么事情发生,IIS甚至不显示在日志请求,直到它完成。
我真的不知道它的平均时间在做什么。

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.

编辑:
所以,我有一些更多的信息,现在,finall得到了失败的请求日志工作(不得不给用户IIS_IUSRS的权限),但我有一些日志,看看怎么回事

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 

正如你可以看到它需要2分钟插图中的两个事件,任何人都中遇到这之前?

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

推荐答案

这是有点分不清什么是您的其他服务器上的事情,但是这就是你可能要重新考虑一个简单的清单:

This is somewhat hard to tell whats going on on your other server, however here's a simple checklist you might want to reconsider:


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

请不要运行调试=真正的启用,当调试标志是你的web.config如此,更多的内存中使用的生产中的应用应用程序运行时,由于一些额外的调试路径启用,codeS可以执行慢得多

Do not run the production application with debug="true" enabled, when debug flag is true in your web.config, Much more memory is used within the application at runtime, and since some additional debug paths are enabled, codes can execute much slower

检查您的Web.config文件,以确保跟踪中禁用<跟踪和GT; 部分

Check your Web.config file to ensure trace is disabled in the <trace> section

IIS 7.5自带的自动启动功能。 WAS(Windows进程激活服务)开始被配置为自动启动的所有应用程序池,请确保您的应用程序池在IIS 7.5 AlwaysRunning >的applicationHost.config ,<一个href=\"http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx\">check在这里的更多细节

IIS 7.5 comes with the Auto-Start Feature. WAS (Windows Process Activation Service) starts all the application pools that are configured to start automatically, ensure that your application pool is configured to AlwaysRunning in the IIS 7.5 applicationHost.config, check out here for more detail

查看 ASPNET.CONFIG 文件,看是否在两台服务器上的配置仍然是相同的。每个asp.net服务器可以通过 aspnet.config 得到很好的配置位于框架文件夹的根文件

Check out the ASPNET.CONFIG file to see if the configuration on both servers are still the same. Every asp.net server can be well configured by aspnet.config file located in the root of the framework folder

确保为code访问安全性(CAS)的发行者证据被设置为false在aspnet.config文件,当您重新启动ASP.NET应用程序池这可能会增加初始页面加载。你可以读<一个href=\"http://blogs.msdn.com/b/pfedev/archive/2008/11/26/best-practice-generatepublisherevidence-in-aspnet-config.aspx\">more它这里。

Ensure that Publisher Evidence for Code Access Security (CAS) is set to false in your aspnet.config file, This might increase the initial page load when you restart the ASP.NET app pool. you can read more about it here.

下面是如何禁用检查CAS发行策略的应用程序:

Here's how to disable checking for CAS publisher policy for an application:

<configuration>
    <runtime>
        <generatePublisherEvidence enabled="false"/>
    </runtime>
</configuration>


  • 你也可能想尝试应用程序初始化模块IIS 7.5 ,在IIS上可用此模块还8.0可降低响应时间由pre加载的工作进程首先要求

    • also you might want to try Application Initialization Module for IIS 7.5, this module also available on IIS 8.0 can decrease the response time for first requests by pre-loading worker processes
    • 这篇关于IIS应用程序池回收很慢后7.5 Web应用程序首次请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆