ASP. NET performance adjustment solves server too busy errors

Source: Internet
Author: User
A recent company ASP. NET Frequent site appearance Server too busy Error: slow page response and frequent appearance Server too busy Exception, but the actual server resource consumption is very low, CPU Only 10% Left and right, very strange.

The running environment of this site isWindows 2000,Iis5.0,. NET Framework 1.1The site pressure is about per second10Connections. The peak value is about30.

After searching for relevant information on the Internet, we can see from the display (slow response, throwServer too busyException). It is preliminarily determined that the thread is blocked due to too many connections at the same time. ModifyWeb. configInHttpruntimeIn the configuration sectionApprequestqueuelimitAfter the parameter,Server too busy. This parameter defaults fromMachine. config. The default value is100, Changed1000AfterServer too busy.

Although the server is busy and the error is solved, the site response is still slow, sometimes waiting5-10Seconds to open the page. The reason should be that there are too many requests at the same time, andIISCause of insufficient working threads, modifyMachine. configMediumProcessmodelConfiguration sectionMaxworkerthreadsThe parameter is200The slow response speed of the site is solved. The default value of this parameter is20You can adjust the Pressure Based on the server hardware configuration.

The reason is that the siteProgramUsedHttpwebrequestThis operation is quite time-consuming (the slow response of the external server is the main reason ). When a visitor's request arrivesASP. NETWorker ProcessAfter,ASP. NETFirst, check whether there are any availableWorker thread(Workerthread), If yes, it will be handed over to a idle working thread for processing. If there is no idle working thread, the request will be put in the request queue (Requestqueue), The response is slow. When the request queue is full due to a large traffic volume,ASP. NETWill throwServer too busyException. In. NET 1.1The default working thread and request queue are20And100WhenCodeThese two default values are obviously too small when the traffic is large and time-consuming. (The current server hardware is cheap, generallyPCThe server throughput should be much higher than this value ). These two values can be reasonably configured based on the server pressure. To adjust the site throughput.

Complete!

Related Article

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.