Search Site
Blog Sponsors

Contact Kent for Sponsorship Information

Topics
RSS Feed
« EC2 UI - Firefox Tool for using Amazon EC2 | Main | Amazon S3 Bucket Explorer »
Monday
20Aug

The Power of mod_deflate

This note isn't so much about overall scale but what is here can allow a site to do more with less in some ways.  It can also save you money.  But, recently I was faced with a server farm that saw a pretty good increase in traffic.  But, I'm not going to go into that so much.  All I really wanted to point out with this post is that a little apache module add-on called "mod_deflate" can save you 66% on your bandwidth over time.  Take a look at this screen shot from a monitoring tool.deflate-graph.png
 I inherited this site from a previous administrator.  During the event that caused the red bar which I'd rather not discuss I was auditing the servers and then told that for some reason mod_deflate had been turned off on the server.  I also found out were were not minifying.  What you see there is the effect of turning on mod_deflate and minifying all javascript and css.  The effect is a rather profound drop in outbound traffic even though we continue to see much higher levels of traffic to the sites hosted on this cluster due to a promotion that is going on right now.  So, if you ever doubted mod_deflate's power, doubt no more.  There is little proof for you.

There are a couple of down sides to mod_deflate you might not think of right away.  It can cause a pretty dramatic increase in CPU usage on a busy site.  So, be mindful that to use it effectively, you'll need a bigger CPU in some cases.  Additionally, not all web browsers like mod_deflate.  So, you'll have to content w/ the usual suspects.  Finally, it's not a magic cure-all.  You still have to write good code on the back end please.  But, using mod_deflate with apache can certainly make things more efficient with regards to outbound traffic.  Also, I do believe the lighttpd 1.5 has built in support for deflate and 1.4 can be configured with it as well.

Here is the most basic type of mod-deflate setup, for example only, that will compress a few number different files

 

AddOutputFilterByType DEFLATE text/html text/plain text/xml

 

EmailEmail Article to Friend

Reader Comments (1)

Agreed mod_deflate can be a real benefit, especially with XML/AJAX data. If you're not running Apache, there are other options using a compressing servlet filter in your J2EE web container. I believe it's also possible to enable response compression using php.

Configuring mod_deflate can be tricky, since the module is not compiled/installed by default. Check out some tips for configuring mod_deflate.

September 7, 2007 | Unregistered CommenterChuck

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>