We are having a very strange situation with one of our websites. On some days the performance is consistently fine across the entire day, on others days consistently slow across the entire day.
For example a small page ('get_status.asp') is requested about 10 times per second by the 3000 unique visitors per day. On good days it takes 30-40ms, on bad days 250-500ms.
The application pool is recycled every night at 3am.
I found out that on bad days IIS is running in single threaded mode executing a maximum of two requests at a time, on good days there seems to be no limit.
A DebugDiag report shows on bad days:
COM+ STA ThreadPool Report
Max STA Threads 50
Min STA Threads 4
Current STA Threads 4
g_activitiesPerThread 1
EmulateMTSBehavior False
STA Threads In-Call 0 (none)
Even though 50 threads are allowed, only 4 are used (2 processors). In perfmon I can see that a lot of ASP-requests are being queued, causing the slow response times (because of high Reques wait times).
On good days all 50 threads are used (see Current STA Threads
):
COM+ STA ThreadPool Report
Max STA Threads 50
Min STA Threads 4
Current STA Threads 50
g_activitiesPerThread 1
EmulateMTSBehavior False
STA Threads In-Call 0 (none)
Some information
- Server is Windows 2003 R2, on VM-Ware ESXI. 2 CPU's assigned, 2GB memory
- Load is spread quite evenly across the day. At the busiest moment there are about 25 requests/second. The CPU's are running nicely at 25%, memory usage is 750MB (out of 2GB available)
- The website only uses Classic ASP. No ASP.NET is involved.
- Server Side ASP debugging seems to be able to cause this. However, it is turned off (I never used it, certainly not on a production server)
- Storing COM-objects in Application or Session variables seems to be able to cause this. We do use Application and Session variables but only store basic types like strings and numbers.
What puzzles me most is the apparent randomness: I have seen Monday good, Tuesday bad, Wednesday good but also the other way around. Sometimes every day of the week is bad, sometimes an entire month(!) is good.
What makes IIS decide to use single threaded mode the entire day until the next application pool recycle?
Update
On another machine I have four websites running (for different URL's), each with their own application pool but all running the same software. Today I discovered that one out of those four is also stuck at exactly 4 thread, the others ones happy use up to 50 threads.