2

I have been looking all over the internet and still not able to find how to change default values of maxWorkerThreads for a CLR threadpool using IIS 7. When I select and application pool and go to advance settings I do see process model (which MSDN is harping about everywhere on the internet) in order to configure values for max and min worker threads. But I'm not able to find where these property names are hidden and whenever I open aspnet.config file it has no default element by the name processModel. And also when I read this article http://blogs.msdn.com/b/tmarq/archive/2007/07/21/asp-net-thread-usage-on-iis-7-0-and-6-0.aspx it says go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727.0 and change MaxConcurrentRequestsPerCPU value which is not present there by default but in .net 4.0 value of this property is 5000 by default. Does that mean I still need to go to above mentioned registry path and configure it's value to 5000 (may be that path is for .net 2.0 i need to go for a path giving me a way to configure the same property in .net 4.0).Since this article is saying that .net 4.0 depends on maxConcurrentRequestPerCPU rather than maxConcurrentThreadsPerCPU.

And the biggest confusion is that if I go to IIS manager and select webserver and in the right pane (in IIS manager) click ASP I can change Threads per processor limit. How does this thread per processor limit is different from maxWorkerThreads per processor or maxConcurrentThreadsPerCPU. I read that Threads per processor limit is the nummber of threads created by IIS so I would assume that its IIS' I/O threads not CLR threadpools worker thread. Is my assumption right or wrong?

Please clear all these doubts of mine, MSDN is not giving clear cut difference between Threads per processor limit, maxConcurrentThreadsPerCPU and maxWorkerThreads of CLR. It's all so confusing.

user2913184
  • 590
  • 10
  • 33
  • 1
    ASP.NET does not have worker threads. It uses the thread-pool and adds it's own throttling. Increase the thread-pool limits which is easy, then test. – usr Jun 21 '15 at 22:32
  • @usr thanks for replying well I know that CLR threadpool is what has worker threads not asp.net but as I mentioned I did increase Threads per processor limit in IIS manager but how does this limit differ from CLR threadpool worker threads and I'm not able to find a way in IIS 7 manager how to change value of CLR worker threadpool threads. – user2913184 Jun 21 '15 at 22:37
  • Google: ".net increase thread-pool limits". There you go. Be sure to test this. Run a load test with Thread.Sleep(1000) as the body. – usr Jun 21 '15 at 22:40
  • I searched this string in google and all the links that I'm coming across are saying either set the CLR threadpool worker limit in your c# code or configure in aspnet.config file. – user2913184 Jun 21 '15 at 22:45
  • First I can't refactor the code and secondly as I mentioned above in my question that whenever i open aspnet.config file I don't see any element with the name configuration i.e. by default it's not there and IIS 7 is not giving me either any kinda option for configuring values of properties like CLR threadpool worker threads as is mentioned in so many documents on MSDN – user2913184 Jun 21 '15 at 22:48
  • http://stackoverflow.com/questions/1939230/asp-net-processmodel-configuration-optimization and https://msdn.microsoft.com/en-us/library/ms178685.aspx... You can't configure values you want in site's web.config. – Alexei Levenkov Jun 22 '15 at 01:09
  • @AlexeiLevenkov when did I want to configure values in web.config, I'm talking about aspnet.config which is totally different from web.config. – user2913184 Jun 22 '15 at 01:11
  • But your post is about IIS7? aspnet.config is 7.5 or I'm missing something? – Alexei Levenkov Jun 22 '15 at 01:15
  • You are right aspnet.config is for 7.5 but for IIS 7 MSDN talks about machine.config file and just now I checked it on a windows 7 development machine and I don't see any of these values configured with their default values inside machine.config file. – user2913184 Jun 22 '15 at 01:19
  • And also the confusion is not just where to put these values for configuration i.e. use IIS 7 or machine.config. But what is difference between terms Threads per processor limit, maxConcurrentThreadsPerCPU and maxWorkerThreads of CLR threadpool. – user2913184 Jun 22 '15 at 01:21
  • And the third thing is that when MSND is saying that maxConcurrentRequestsPerCPU is by default 5000 for .net 4.0 does that mean do I still need to configure this value in the registries as mentioned in my question or .net 4.0 automatically knows that it's 5000 so no need to configure it. – user2913184 Jun 22 '15 at 01:24
  • Does your web service make calls to another web service? If it does, you need to be aware of the interaction between the outgoing connection limit and the thread pool thread limit. – Ben Nov 09 '16 at 09:44

0 Answers0