I have a WCF service hosted in a Windows service, InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple
Nettcp binding is configured with listenbacklog = "512", and service behavior is configured with maxConcurrentCalls = "512"
Both the server and the client run on quad-core processors, doing nothing.
My test client uses an automatically generated proxy and makes 25 asynchronous calls in 25 threadpool threads. Although the number of threads slowly grows to all 25, it immediately spawns 10 threads and then starts an additional thread every second or so. The WCF server generates 2-3 threads for serving requests. The work performed by the service function takes several hundred milliseconds. It takes about 20 seconds of wall clock time to complete all client calls.
I have profiled the WCF server and it spends most of the time in ThreadStart_Context calling waitone ()
Can someone tell me why it is so slow?
source
share