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

You cannot post until you login.


  Latest Features
Hans Kwint: Updating from Ubuntu LTS 16.04 to 18.04
May 03, 2018

Dr Tony Young: A KMail Breakthrough.
May 01, 2016

James Dixon: Installing jstock with Slackware 14.1
Jan 19, 2016

James Dixon: Installing sbopkg with Slackware 14.1
Jan 16, 2016

James Dixon: Open Source Wealth Management
Jan 15, 2016

Hans Kwint: GNUifying Windows: Make the best of imposed Windows-use at work
Oct 23, 2015

Dr. Tony Young: Update to "How long is a piece of string?"
Oct 20, 2015

Russell Hollander: Chromebooks, Linux, and Lenovo
Sep 23, 2015

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

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 ]