Mar 17

The Effects of ASP.Net Caching

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.


Comments

by Brian,   March 17, 2006 5:23 AM  

Are you running this app using Mono on an LAMP system for those numbers or a Windows server system?


by Deane,   March 17, 2006 6:42 AM  

Are you running this app using Mono on an LAMP system for those numbers or a Windows server system?

Windows Server 2003.


by Another Brian,   March 17, 2006 9:15 AM  

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.


by Deane,   March 17, 2006 9:40 AM  

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.



Add Comment


Want to advertise on this site? Contact FM.
Web Hosting Web hosting, dedicated servers and Web design services
Laser Toner Cartridges UK laser toner, toner cartridges, hp toner, lexmark toner, samsung toner, canon, toner, epson toner, oki toner, kyocera toner, xerox toner, remanufactured toner, compatible toner
Direct TV Deals Free 4 room direct tv deals. no equipment to buy. free fast professional direct tv installation. this is the best direct tv deal available anywhere.
SEO Article Learn from the experts with our SEO article.
rope light Shopping with birddog distributing, inc., gives you access to the lowest prices, the best customer service and the quickest delivery times possible.
Laptop AC Adapter We offer genuine factory direct replacement AC adapters.
Direct TV Best satellite TV deals.
Direct TV Deals Direct TV programming deals are varied and include packages containing from 50 channels up to over 250 channels.
8mm film to DVD Retain family memories with the only frame by frame digital restoration service in the United States for your 8mm film to DVD today
Rubber Stamp Shop for custom self-inking stamps, hand stamps, address stamps, label stamps, check endorsement stamps, check deposit stamps, date stamps, pre inks, pocket stamps, ink and much more!