NOTICE:
This content is in the "archives" of a retired blog called Gadgetopia. It has been moved to this subdomain as it is no longer considered relevant to the site. It is being hosted here for a indeterminate period of time. Its existence at this URL is not guaranteed, and it may be removed at any time. If you would like to refer to this content in the future, you are encouraged to save it to your local file system.

Some content from Gadgetopia was moved to the technical blog on deanebarker.net

The Effects of ASP.Net Caching

Originally published by "dbarker" on 2006-03-17 07:21:00Z

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:

Now for some CMS-enabled pages

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:

(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.

Comment by "Brian" on 2006-03-17 11:23:00Z
Are you running this app using Mono on an LAMP system for those numbers or a Windows server system?
Comment by "Deane" on 2006-03-17 12:42:00Z
>Are you running this app using Mono on an LAMP system for those numbers or a Windows server system? Windows Server 2003.
Comment by "Another Brian" on 2006-03-17 15:15:00Z
What type of architecture do you have? Is the web tier on the same machine as the database? Have you looked at performance counters or another profiler? Your testing methodology seems insufficient, but I assume the app feels 'laggy' to you. We've got a CMS that does extensive work for each request since each page is data driven but has it's own access control list entry in our database which is checked. It handles 500 rps with less hardware than you have and zero caching. CPU utilisation is normally not a limiting factor but the naive often believe CPU determines performance... Either you have a seriously complex system, or you have seriously poor code/architecture. I would bet it's the latter, you are probably screwed if the issues are in the 3rd party code and you can't update it.
Comment by "Deane" on 2006-03-17 15:40:00Z
>Either you have a seriously complex system, or you have seriously poor code/architecture. I would bet it's the latter, you are probably screwed if the issues are in the 3rd party code and you can't update it. I've discussed this with the vendor, and there's a specific situation with exactly what I'm doing which is causing the performance problems. I went a bit "outside the lines" with one of their components. But, regardless, so long as I cache, then I'm quite happy.