Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF high instance count: anyone knows negative sideffects?

Did anyone experience or know of negative side effects from having a high service instance count like 60k? Aside from the memory consumption of course.

I am planning to increase the threshold for the maximum allowed instance count in our production environments. I am basically sick of severe production incidents just because "something" forgot to close a proxy properly.

I plan to go to something like 60k instances which will allow the service to survive using default session timeouts at a call rate average for our clients.

The throttling settings would be:

  • maxConcurrentCalls = 100
  • maxConcurrentSessions = 60000
  • maxConcurrentInstances = 60000
  • InstanceContextMode = PerSession

Thanks, Alex

like image 795
Alex Avatar asked Oct 25 '22 12:10

Alex


1 Answers

The default concurrent instances is Unlimited. 60k will make no difference.

When you aren't applying throttling to your service, the defaults are

•maxConcurrentCalls = 16
•maxConcurrentSessions = 10
•maxConcurrentInstances = Unlimited

There are multiple ways to apply throttling and expanding the defaults but all of that depends on your InstanceContext, Concurrency, and Session modes? Based on these answsers there are optimal configuration settings I can suggest.

I cover some of this in my article on ESB through WCF / Trottling Here

UPDATE:

Thanks for your response. Per Session is fine. There is a good article on optimizing your WCFService Here

They recommend changing your settings to slightly higher than 16 * the number of CPUs. Since you are using per session, You should set your ConcurrentCalls to 1-3% of your Concurrent Instances.

So let's say you have 8 Cores in your Server. I would recommend a starting point your settings on a per session service like so:

<serviceThrottling maxConcurrentCalls="6"
  maxConcurrentInstances="200"
  maxConcurrentSessions="200"/>

This should eliminate your problems w/ clients not closing connections, especially if you are currently using the default of 10 sessions. You server should be able to handle much much more, but 60k is probably overkill. You can test and increase as needed. It all depends on the power of the box and what else you are using it for.

Based on these settings if you need to grow further you can monitor performance and see if you can increase them, otherwise, you could easily scale out to more servers and Load balance.

Hope this helps... happy Coding

like image 138
CkH Avatar answered Nov 15 '22 06:11

CkH