Software Review: mod_gzip trims bandwidth utilization by 77%

Posted by dave on Jan 19, 2004 12:59 PM
LXer; By Dave Whitinger

Let it not be said that I didn't tell you about the neatest apache module since the introduction of php: mod_gzip.

Almost all browsers on earth support gzip data encoding, yet almost no servers are configured to take advantage of this.

Through the miracles of gzip compression, you can configure your Apache to:

1) Determine that the browser is capable of accepting gzip. and then 2) Compress your web page and finally 3) Send the gzip compressed page to the visitor.

Now, this is useless if you are serving mostly content that is already compressed, such as images. However, if you have an extremely text-intensive site, such as discussion forums, technical manuals, and what-have-you, gzip can save anywhere from 70%-90% of your bandwidth. Additionally, instead of causing the visitor to download a 100K page, they only download about 10K of compressed data. Not bad!

Well, let's test this in a real world environment. I've been running mod_gzip for well over a year, but until today had never actually looked at its effectiveness... I just grabbed today's logfile for Dave's Garden, and, after removing all the images and such, I tailed out the last 5,000 hits.

My mod_gzip is configured to print out the "IN" and "OUT" numbers for each hit to my server. The "IN" field is the raw size of the text, and the "OUT" is the exact size of the compressed data that is then sent to the browser.

I wrote a script to look at these 5,000 hits and report on what it found. Here is the result:

Total bandwidth, before compression: 92,074,836 bytes. Total bandwidth, after compression: 21,301,279 bytes.

Average page size, before compression: 4,836 bytes. Average page size, after compression: 1,279 bytes.

Total bytes saved: 70,773,557 bytes. Average bytes saved, per hit: 77%.

See that? My server should have sent 92 megs, but only had to send 21 megs. WHAT A SAVINGS! It's only sending 1/4 the data that it would normally send without compression. That saved me big on bandwidth, and additionally the text and HTML pages are loading 4 times faster than my customers' competitors!

If you don't already have it, installing mod_gzip on your own Apache server is about the best thing you could do to improve your server.

Return to the LXer Features

Subject Topic Starter Replies Views Last Post
Thanks! rob 1 1,783 Feb 19, 2004 8:34 AM

You cannot post until you login.

LXer

  Latest Features
ubuuser: The good and bad of Ubuntu 13.04 beta 2
Apr 15, 2013

Scott Ruecker (Phoenix, U.S.): LXer Weekly Roundup for 10-Mar-2013
Mar 11, 2013

Scott Ruecker (Phoenix, U.S.): LXer Weekly Roundup for 03-Mar-2013
Mar 03, 2013

: Ubuntu Touch Developer Preview released
Feb 21, 2013

Scott Ruecker (Phoenix, U.S.): LXer Weekly Roundup for 17-Feb-2013
Feb 18, 2013

Scott Ruecker (Phoenix, U.S.): LXer Weekly Roundup for 03-Feb-2013
Feb 04, 2013

Nick Black, SprezzOS Project Hacker-in-Charge: SprezzOS emerges, promising new-school tech with old-school gumption
Feb 02, 2013

Scott Ruecker (Phoenix, U.S.): LXer Weekly Roundup for 27-Jan-2013
Jan 28, 2013

Scott Ruecker (Phoenix, U.S.): LXer Weekly Roundup for 20-Jan-2013
Jan 21, 2013

ubuuser: Ubuntu releasing smartphone OS has better chance than other platforms
Jan 09, 2013


View all

  Search Features

Search LXer Features:

[ Copyright © LXer | All times are recorded in Central Daylight Time (CDT) ]

[ Contact Us | Privacy Policy | Terms of Service | About us | rss | Mobile ]

Login