Iam new to WCF Services.
We have a service which listens to an MSMQ. maxConcurrentInstances and maxConcurrentSessions is set to 1 for the service. which results lot of messages in the queue and messages are served slowly.
What is the difference between maxConcurrentInstances and maxConcurrentSessions attribute in the serviceThrottling element.
Currently it takes 10 Mins to serve 120 Messages which is very slow.
What should be the ideal value to improve the performance of the service.
Thanks in Advance
maxConcurrentInstances: Maximum number of instances of the service class that can serve requests at the same time regardless of the concurrency mode and instance context mode.
maxConcurrentSessions: Maximum number of WCF sessions active at the same time.
Assuming the concurrency mode is set to NO multithreading.
IF Instance context mode = Per session
THEN Max number of requests processed in parallel = Min(maxConcurrentInstances, maxConcurrentSessions)
IF Instance context mode = Per call
THEN Max number of requests processed in parallel = maxConcurrentInstances
IF Instance context mode = Single
THEN Max number of requests processed in parallel = 1
Assuming that concurrency mode is set to multithreading.
A single instance can now process several requests but you have to take care of the concurrency issues.
The important question is: how do you choose the instance context mode?
After that it is a matter of tuning the max number of instances (for PerCall) and sessions (for PerSession). Usually you start by setting it to an arbitrary number like 100 and see if it make thing faster. If it does, then fine. If not, check if your instances are sufficiently quick to create.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With