wcf 应用程序变慢,通过回收 IIS 应用程序池纠正,我可以监视什么以查看出了什么问题

wcf app slowing down, corrected by recycling IIS app pool, what can i monitor to see what is going wrong

WCF 应用内置于 .net 4.5,运行 windows 服务器 2012 R2 数据中心。 IIS 8. 客户端是一个点击一次的 WPF 应用程序。

该应用程序已经 运行 多年,但开始越来越陷入困境,需要应用程序池回收每天纠正一次或两次。我找不到任何迹象表明到底出了什么问题。 RAM 达到 75% 的峰值,大部分保持在 50% 左右,cpu 是 运行 在 10% 到 20%。当我回收池时,那里没有什么真正的改变。

我的主要线索是应用程序使用 TCP,当我将本地调试会话切换到 HTTP 时,它再次快速运行,在 TCP 模式下它很慢。我知道 HTTP 位于 TCP 之上,所以我想知道它是否与握手有关。

TCP 绑定看起来像这样

   <binding name="TCPSecured" receiveTimeout="00:05:00" sendTimeout="00:05:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    </binding>

HTTP

<binding name="HTTPBindingConfig" receiveTimeout="00:05:00" sendTimeout="00:05:00" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
  <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Windows" />
  </security>
  <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>

使用资源监视器查看 TCP 连接,我看到有几十个具有高延迟,超过 200 个。不知道那是什么意思,也不知道它是否是新的。

使用性能监视器我已经尝试跟踪来自 ASP.Net 应用程序、TYCPv4 和 TCP v6 以及许多其他应用程序的许多选择,它们都显示低到没有 activity。

我对这些东西不知所措,非常感谢人们提供的任何见解。

问题是由于 TCP 端口处于打开状态。一旦我能够监控它,就可以找到问题所在。结束使用 powershell 命令。

检查一个端口

$established = Get-NetTCPConnection -LocalPort 890 -State Established
$count = $established.Length
echo "OK - $count established connections on port 890 Business"

看看所有这些。

$netstat = netstat -aon | Select-String -pattern "TCP "
$processList = Get-Process
foreach ($result in $netstat) {
   $splitArray = $result -split " "
   $procID = $splitArray[$splitArray.length – 1]
   $processName = $processList | Where-Object {$_.id -eq $procID} |    select processname
   $splitArray[$splitArray.length – 1] = $procID + " " +      $processName.processname
   $splitArray -join " "
}