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!