ericx
ericx

Reputation: 125

How to find out how many concurrent connections to WCF service exists?

I need to determine how many users are connected to a WCF service. I am using the NetTcpBinding.

Thank you.

Upvotes: 10

Views: 10653

Answers (2)

Daniel Vassallo
Daniel Vassallo

Reputation: 344351

WCF services includes performance counters that you can track with the Windows Performance Monitor (Perfmon.exe). You can launch this from the Administrative Tools in Windows Server 2003.

Performance counters can be enabled from the diagnostics section of the .config file for the service, as shown in the following sample configuration:

<configuration>
  <system.serviceModel>
    <diagnostics performanceCounters="All" /> 
  </system.serviceModel>
</configuration>

You may want to check out these articles which can guide you on how to use the performance counters for WCF services:

Upvotes: 9

Jader Dias
Jader Dias

Reputation: 90485

If you implement your service to count the number of live connections you could obtain this number for every binding. But since you specified that you are using the net.tcp binding I think you should use netstat or a packet sniffer tool, like Wireshark, for that purpose.

If your server is hosted in IIS, I think it can give some usage statistics.

Upvotes: 0

Related Questions