What is the maximum number of threads available in Asp.net ThreadPool
Just out of curiosity , What is the maximum number of threads available for handling request in asp.net.
And does asp.net releases them for any I/O or database operations so that maximum number of requests can be handle开发者_如何学编程d?
It is controlled via machine.config.
configuration > system.web > processModel
<processModel
maxWorkerThreads="num"
maxIoThreads="num"
minWorkerThreads="num"
minIoThreads="num"
...
/>
It is set on a per CPU basis. Default for single CPU is 20/20.
http://msdn.microsoft.com/en-us/library/7w2sway1(v=VS.100).aspx
In .net 4.0 has it is 250 worker threads per CPU and 1,000 I/O completion threads...
To release worker threads for I/O operations, you'll want to use the async/await pattern. When you "await" an async file operation, the thread will be released back to the ASP.NET thread pool, which is then used to process other requests until your file i/o operation is completed.
http://www.asp.net/mvc/tutorials/mvc-4/using-asynchronous-methods-in-aspnet-mvc-4
精彩评论