Home > View Post

ThreadPool Settings in machine.config

I've had to use the documents I linked to in my post about Tuning the ThreadPool a number of times and it's a struggle to remember which elements in the machine.config each setting should be applied to. So I'm going to post all the details here for reference. N is the number of processors, including virtual processors in hyperthreaded CPUs.

Inside /configuration/system.web:

<processModel maxWorkerThreads="100" maxIoThreads="100" minWorkerThreads="50" ... />

Inside /configuration/system.web:

<httpRuntime minFreeThreads="88xN" minLocalRequestFreeThreads="76xN" ... />

inside /configuration/system.net:

<add address="* or providerIPHere" maxconnection="12xN"/>

This information is taken from this Microsoft Support Entry.

If you're lucky enough to be using .NET 2.0 or above you can simply set the autoConfig attribute of the processModel element to true (inside system.web).

<processModel autoConfig="true" />

However, note that these changes will only apply to web applications in this instance.


Josh Post By Josh Twist
1:56 AM
06 Apr 2006

» Next Post: Project Gestation and Team Size
« Previous Post: Flexibility in Software

Comments are closed for this post.

Posted by wsnet @ 01 May 2006 9:14 AM
I tried your settings with N set to 4 (# of logical CPUs with hyperthreading enabled) and I got an error "The value for 'minFreeThreads' must be less than the thread pool limit of 200 threads". Any ideas?

Posted by wsnet @ 01 May 2006 11:15 AM
I thought hyperthreading was enabled but actually it was not. My fault. Sorry for the post.

BTW, good work!

© 2005 - 2021 Josh Twist - All Rights Reserved.