Praneeth
Praneeth

Reputation: 2547

w3wp.exe exceeding max threads

we have requirement to handle 10000 concurrent user.

Let me explain the system. Machine has two processors. ProcessModel in machine.config is set as autoconfig = true. so that makes maxWorkerThreads = 20.

When I Load run my case with 30 users and watch CPU usage it is maximing to 100. and number of threads on w3wp.exe is more then 70. As my default is 20 * 2 (CPU's) = 40.

Once cpu touches 100% most of the transaction fail or talking maximum time to respond

Now questions 1. how do i get 30 more threads assigned to the same workerprocess? 2. How can reduce CPU usage here?

Upvotes: 2

Views: 5275

Answers (2)

daniel
daniel

Reputation: 155

You should take a look at making async calls so that your threads are not remaining active while the caller is waiting for a response.

http://msdn.microsoft.com/en-us/magazine/cc163463.aspx

Upvotes: 1

ziesemer
ziesemer

Reputation: 28687

You have a bit of an issue here. Increasing the # of threads will further increase CPU usage. (Your 2 goals are incompatible.) Not only are you asking each CPU to do more, but you'll have additional overhead with context switching.

You could investigate using a non-blocking IO library, which would essentially mean only 1-2 threads per CPU. However, this could be a significant architecture change to your project (probably not feasible) - and what you might actually find is that most of the CPU was actually spent due to the work your code is performing, and not because of anything threading-related.

It sounds like you need to do some performance tuning and optimization of your application.

Upvotes: 1

Related Questions