Reputation: 141
I am benchmarking a self-hosting nettcp WCF service, making requests from 50 threads to a service located no the same computer. The problem is that the CPU utilization never exceeds 35% on Xeon E3-1270. When I run the same test on a two core laptop it does reach 100%.
The WCF method does nothing, so it should not be limited by IO. I tried to increase the number of threads, but that does not help. Each thread creates a service channel and performs thousands calls reusing that channel instance.
Here is the service class I am using:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
public class TestService : ITestService
{
public void Void()
{
// DO NOTHING
}
}
Configs:
ServiceThrottlingBehavior: MaxConcurrentCalls = 1000 MaxConcurrentInstances = 1000, MaxConcurrentSessions = 1000
NetTcpBinding ListenBacklog = 2000 MaxConnections = 2000
Upvotes: 4
Views: 699
Reputation: 3129
I would try changing your InstanceContextMode to PerCall. I'm pretty sure your current configuration setting will be ignored because WFC only ever creates a single instance of your class and will process them in order. With PerCall a new instance will be created for each request until the maximum number of threads or your configuration limit has been reached. You shouldn't need the netTcpBinding setting either, but keep your Throttling behaviour but make sure you get your proportions right otherwise might have adverse effects.
Upvotes: 1