Home > Net >  wcf app slowing down, corrected by recycling IIS app pool, what can i monitor to see what is going w
wcf app slowing down, corrected by recycling IIS app pool, what can i monitor to see what is going w

Time:10-28

WCF app is built in .net 4.5, running on windows server 2012 R2 datacentre. IIS 8. Client is a click once WPF app.

the app has been running for years but has started to increasingly get bogged down requiring an app pool recycle to correct once or twice a day. I am unable to find any indicator of what exactly is going wrong. RAM is peaking at 75% mostly staying around 50% , cpu is running at 10 to 20%. Nothing really changes there when I recycle the pool.

My main clue is that the app uses TCP and when i switch my local debug session to HTTP it runs quickly again, in TCP mode it is slow. I know HTTP is layered on top of TCP so I wonder if it has to do with handshaking or something.

TCP binding looks like this

   <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>

using resource monitor looking at TCP connections I see dozens that have a high latency, over 200. No idea what that means or if it is new.

using Performance monitor i have tried tracing many selections from ASP.Net applications, TYCPv4 and TCP v6, plus dozens of others, they all show low to no activity.

I am over my head with this stuff and would appreciate any insights people can provide.

CodePudding user response:

The problem was due to TCP ports being left open. Once I was able to monitor it, that allowed me to find the issue. Ended up using powershell commands.

To Check on one port

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

To look at all of them.

$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 " "
}
  • Related