【问题标题】:What can cause an IIS application to reset?什么会导致 IIS 应用程序重置?
【发布时间】:2011-10-22 18:25:00
【问题描述】:

我正在使用 healthMonitoring 部分监控我的网站。我看到一条消息...

Event code: 1002 
Event message: Application is shutting down. Reason: Hosting environment is shutting down. 
Event time: 8/8/2011 3:29:59 PM 
Event time (UTC): 8/8/2011 8:29:59 PM 
Event ID: 6879adf29cdc403ba8ad2e5694b6cee0 
Event sequence: 730 
Event occurrence: 1 
Event detail code: 50002 

我无法确定它关闭的原因。我的应用程序池设置为每 24 小时重置一次。我的 web.config 会话设置为 4 小时后过期(无论如何这不应该影响应用程序关闭)。我看到一些帖子提到 healthMonitoring 设置可以重置应用程序,但我没有看到任何特定的设置可以做到这一点。另外,我在添加 healthMonitoring 部分之前就注意到了这个问题。

仅供参考,下面是它的读法...

    <healthMonitoring>
        <bufferModes>
            <add name="Critical Notification" maxBufferSize="100" maxFlushSize="20"
                    urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00"
                    maxBufferThreads="1" />
            <add name="Notification" maxBufferSize="300" maxFlushSize="20"
                    urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00"
                    maxBufferThreads="1" />
            <add name="Analysis" maxBufferSize="1000" maxFlushSize="100"
                    urgentFlushThreshold="100" regularFlushInterval="00:05:00"
                    urgentFlushInterval="00:01:00" maxBufferThreads="1" />
            <add name="Logging" maxBufferSize="1000" maxFlushSize="200" urgentFlushThreshold="800"
                    regularFlushInterval="00:30:00" urgentFlushInterval="00:05:00"
                    maxBufferThreads="1" />
        </bufferModes>

        <providers>
            <add name="EventLogProvider" type="System.Web.Management.EventLogWebEventProvider,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
            <add connectionStringName="LocalSqlServer" maxEventDetailsLength="1073741823"
                    buffer="false" bufferMode="Notification" name="SqlWebEventProvider"
                    type="System.Web.Management.SqlWebEventProvider,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
            <add name="WmiWebEventProvider" type="System.Web.Management.WmiWebEventProvider,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />
        </providers>

        <profiles>
            <add name="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00"
                    custom="" />
            <add name="Critical" minInstances="1" maxLimit="Infinite" minInterval="00:00:00"
                    custom="" />
        </profiles>

        <rules>
            <add name="All Errors Default" eventName="All Errors" provider="EventLogProvider"
                    profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00"
                    custom="" />
            <add name="Failure Audits Default" eventName="Failure Audits"
                    provider="EventLogProvider" profile="Default" minInstances="1"
                    maxLimit="Infinite" minInterval="00:01:00" custom="" />
            <add name="Application Lifetime Events Default"
                     eventName="Application Lifetime Events"
                     provider="EventLogProvider"
                     profile="Default"
                     minInstances="1"
                     maxLimit="Infinite"
                     minInterval="00:01:00"
                     custom="" />
        </rules>

        <eventMappings>
            <add name="All Events" type="System.Web.Management.WebBaseEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="Heartbeats" type="System.Web.Management.WebHeartbeatEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="Application Lifetime Events" type="System.Web.Management.WebApplicationLifetimeEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="Request Processing Events" type="System.Web.Management.WebRequestEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="All Errors" type="System.Web.Management.WebBaseErrorEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="Infrastructure Errors" type="System.Web.Management.WebErrorEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="Request Processing Errors" type="System.Web.Management.WebRequestErrorEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="All Audits" type="System.Web.Management.WebAuditEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="Failure Audits" type="System.Web.Management.WebFailureAuditEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
            <add name="Success Audits" type="System.Web.Management.WebSuccessAuditEvent,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
                    startEventCode="0" endEventCode="2147483647" />
        </eventMappings>

    </healthMonitoring>

什么可能导致我的应用程序重置?

谢谢!

【问题讨论】:

    标签: session iis web-applications session-timeout


    【解决方案1】:

    使用的内存量可以设置限制,这将导致应用程序池回收,但我不确定这是否给出了您得到的确切消息。请参阅 IIS 管理器中应用程序池的高级设置中的回收。

    【讨论】:

      【解决方案2】:

      IIS 可以出于多种原因重置/重新启动。来自Tess Ferrandez's blog

      • Machine.Config、Web.Config 或 Global.asax 已修改
      • bin 目录或其内容被修改
      • 重新编译的次数(aspx、ascx 或 asax)超过 machine.config 或 web.config 中的设置指定的限制(默认设置为 15)
      • 修改了虚拟目录的物理路径
      • CAS 政策已修改
      • Web 服务已重新启动
      • (仅限 2.0)应用程序子目录被删除

      如果您的应用程序处于空闲状态(默认为 20 分钟无活动)、消耗过多内存或 CPU 时间,IIS 将关闭您的应用程序。

      Web 服务器上运行的防病毒程序也被指责为重置 IIS,我假设通过触摸上面提到的任何文件/目录。

      【讨论】:

        【解决方案3】:

        我正在处理相同的问题,并开始查看其他服务器日志,以查看在回收的确切时间是否发生了其他事情。

        系统 事件日志中我发现:

        为应用程序池“版本 1.2”提供进程 ID 为“6600”的工作进程已请求回收,因为该工作进程已达到其允许的处理时间限制。

        来源是:WAS

        (Windows 进程激活服务)

        我知道原因可能会有所不同,但为了将来参考,还应该查看其他日志。

        【讨论】:

        • 我得到应用程序正在关闭。原因:主机环境正在关闭。在应用程序事件日志中,并且在系统事件日志中具有相同的消息。谢谢它对我帮助很大!
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2010-09-23
        • 1970-01-01
        • 1970-01-01
        • 2021-12-27
        • 2020-05-26
        • 2015-03-02
        • 1970-01-01
        相关资源
        最近更新 更多