For all my issues with .Net – and there are many – it does have a great caching system. With one line at the top of a page (the "OutputCache” directive), you can store a page in memory for X number of seconds. It’s brutally simple, and just as effective.
I’m getting close to finishing up a project involving a commercial CMS based on ASP.Net. I started to do some load testing using Microsoft’s handy Web Application Stress Tool.
First, the baselines for a quad 3.8 GHz Xeon with 4GB of RAM:
Static HTML page: 938 requests per second (RPS)
Static ASPX page: 707 RPS
Now for some CMS-enabled pages
Simple page with a single content element: 220 RPS
Complex page with multiple elements, including some requiring security checks and recursion: 7 RPS
Ouch. That’s not gonna fly given my usage projections.
But what I’ve found is that caching even for the barest amount of time makes a stunning difference. On a five-minute test, the same page from above that only did 7 RPS, did this:
60-second cache: 308 RPS
30-second cache: 303 RPS
10-second cache: 275 RPS
5-second cache: 295 RPS
2-second cache: 264 RPS
(I don’t know why the 5-second cache performed better than the 10-second cache. I don’t know if the 5-second number was abnormally high, or the 10-second number was abnormally low. It could have just been a testing anomaly – I only ran the test once for each interval.)
I think I’m going with with 30-second plan. Needless to say, my blood pressure has dropped considerably.