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,946 Feb 19, 2004 8:34 AM

You cannot post until you login.


  Latest Features
Scott Ruecker (Phoenix, U.S.) : Interview With Richard Kenner of AdaCore
Aug 29, 2014

penguinist: Better Than a Quad-Head Display: My Adventures with "4K" 2160p and Linux
Mar 31, 2014

Dr Tony Young: Replacing KDE4 with Xfce
Mar 07, 2014

Dr Tony Young: Removing/Disabling The Semantic Deskop in KDE4 Running on openSUSE 13.1 Part 2
Feb 18, 2014

Dr Tony Young: Removing/Disabling The Semantic Deskop in KDE4 (and firing up Thunderbird) Part 1
Feb 08, 2014

Dr Tony Young: KMail Complexity - and a little Patience
Jan 26, 2014

Carla Schroder: Linux Nerd New Year's Resolutions
Dec 29, 2013

Carla Schroder: Fedora 20 Released With New, Newer, and Newest
Dec 17, 2013

Dr Tony Young: Trouble-shooting a VoIP Modem
Nov 07, 2013

Hans Kwint - The Netherlands: Linux Malware: Should we be afraid?
Aug 13, 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 ]