IIS不会立即处理请求

时间:2016-09-11 23:30:22

标签: c# performance web-services wcf iis

我在8台服务器上安装了Windows服务,可以调用我们的应用层(由15台服务器组成)。所有这些服务器都在同一个内部网络上,因此他们不需要跨越互联网"。出于某种原因,我们偶尔会看到进入应用层的请求需要几分钟才能完成,而通常只需要1或2秒。发生这种情况时,通常会在不同服务器上发生几个实例。通过在Windows服务服务器上运行Fiddler,我可以看到整个时间都花在等待请求获得响应上(而不是在Windows服务进程本身试图启动线程或获取其他资源或任何东西)。

我已经从Windows服务代码调用之前和之后添加了日志记录,以及在IIS服务中调用的函数的开头和结尾。当问题发生时,我可以看到IIS服务功能仍然在一两秒内完成,但是从Windows服务请求到IIS服务功能实际开始运行之间有几分钟的延迟。 / p>

我还能够在修改Windows服务器的hosts文件时将其直接指向单个应用服务器,绕过防火墙和负载均衡器,从而重现此问题,所以它似乎是IIS服务器本身存在问题。

以下是我在应用服务器上配置WCF服务绑定的方法:

<system.serviceModel>
    <bindings>
        <webHttpBinding>
            <binding maxReceivedMessageSize="1073741824">
                <security mode="Transport"></security>
            </binding>
        </webHttpBinding>
        <wsHttpBinding>
            <binding name="DefaultBindingConfiguration"
                transactionFlow="true"
                bypassProxyOnLocal="false"
                messageEncoding="Mtom"
                maxBufferPoolSize="1073741824"
                maxReceivedMessageSize="1073741824"
                sendTimeout="00:10:00"
                openTimeout="00:10:00"
                closeTimeout="00:10:00">
                <readerQuotas maxDepth="1073741824"
                    maxStringContentLength="1073741824"
                    maxArrayLength="1073741824"
                    maxBytesPerRead="1073741824"
                    maxNameTableCharCount="1073741824"/>
                <security mode="TransportWithMessageCredential">
                    <transport clientCredentialType="None" proxyCredentialType="None" />
                    <message clientCredentialType="UserName" />
                </security>
            </binding>
            <binding name="DefaultBindingConfigurationNoMessageCredential"
                transactionFlow="true"
                bypassProxyOnLocal="false"
                messageEncoding="Mtom"
                maxBufferPoolSize="1073741824"
                maxReceivedMessageSize="1073741824"
                sendTimeout="00:10:00"
                openTimeout="00:10:00"
                closeTimeout="00:10:00">
                <readerQuotas maxDepth="1073741824"
                    maxStringContentLength="1073741824"
                    maxArrayLength="1073741824"
                    maxBytesPerRead="1073741824"
                    maxNameTableCharCount="1073741824"/>
                <security mode="Transport">
                    <transport clientCredentialType="None" proxyCredentialType="None" />
                    <message clientCredentialType="None" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <behaviors>
        <serviceBehaviors>
            <behavior name="DefaultServiceBehavior">
                <serviceThrottling maxConcurrentCalls="160" maxConcurrentSessions="100" maxConcurrentInstances="100" />
                <serviceDebug includeExceptionDetailInFaults="true" />
                <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
            <behavior name="DefaultServiceBehaviorNoMessageCredential">
                <serviceThrottling maxConcurrentCalls="160" maxConcurrentSessions="100" maxConcurrentInstances="100"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <diagnostics performanceCounters="All" />
</system.serviceModel>

我正在寻找任何想法,为什么在发出请求和IIS服务功能实际收到请求之间存在此延迟,或者我可以采取其他措施来解决问题以获取更多信息。任何想法或建议都非常感谢。感谢。

更新

此问题似乎不是由应用服务器重新启动时的应用程序池引起的;在事件查看器日志中没有应用程序池崩溃或重新启动的日志。

0 个答案:

没有答案
相关问题