6

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 handled?

3 Answers 3

5

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

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for that information, But i am still confused on the second part of my question that whether the worked thread is released if asp.net code is busy doing some IO or database operation.
ThreadPool is managed by the framework. As such, its hard to predict when it'll be released. But then, the whole idea is that you shouldn't have to bother with it.
3

In .net 4.0 has it is 250 worker threads per CPU and 1,000 I/O completion threads...

2 Comments

You can control the limit of worker Thread using GetMaxThreads and SetMaxThreads method...
What's your source?
3

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.