About the excessive CPU usage of w3wp Processes

Source: Internet
Author: User
In one of my Asp.net sites, the and B functions are provided, both of which consume Web Server resources (mainly CPU, it takes about half a minute to complete the function. If one user is using one of the and B functions, the CPU usage of w3wp is about 50%. If two or more users use one of the and B functions at the same time, the web server will become overwhelmed, and the CPU usage is nearly 100%. The website can hardly respond to other requests. Basically, a timeout error will be reported on all pages.
I once thought about changing these two functions from the immediate execution mode to creating a task queue. In the early morning, I used a special service to execute tasks in the task queue in sequence. But it is really unwilling to think about it, because it greatly reduces the ease of use of these two features. In addition, such resource-consuming operations on a site should be quite common and should be solved through other more advanced tasks or thread management. Possible solutions I can think of currently include:
(1) configure the thread pool of the website to limit the maximum CPU usage of each thread. (How to set it? Can I only set a fixed percentage or can I set a dynamic value based on the CPU usage of the current server ?)
(2) serialize the functions A and B, that is, create a queue. If a user wants to execute one of the functions a and B, check whether the queue is empty, if it is not null, it is added to the end of the queue. This method is significantly reduced ProgramBut it is easier to operate, and it is much more real-time than the method for executing services in the early morning.

There should be better solutions. Please help me a lot.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.