Advanced

Software Review: mod_gzip trims bandwidth utilization by 77%

Posted by dave on Jan 19, 2004 11:59 AM · 2 comments
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

Comments (2)

Really!! I will use this, and I wonder why I haven't heard of it before. How much money can be saved using this? I mean worldwide. Sure would be interesting to see some calculations..

Make me wonder if Apache is the only server with this (as included module) feature.

/Rob
dave Story submitter ·
Really, I don't know why more people don't know about this excellent module. It doesn't use a lot of extra system resources and it saves an -incredible- amount of bandwidth. I use it on almost all my servers.

How much money does it save? That depends on how much your bandwidth costs, and how much of your website is compressable (images don't compress, so only text and html will be gzip'ed).

Try it out and do some tests for yourself. It's the best tip of the year! :-)

dave

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post

LXer

  Latest Features
bob: LXer now speaks Markdown
Oct 27, 2026

bob: How to protect against PHP2Shell
Oct 26, 2026

Scott Ruecker (San Diego, U.S.): Linux That's Small
Oct 14, 2024

penguinist: Encryption, Trust, and the Hidden Dangers of Vendor-Controlled Data
Aug 27, 2024

Scott Ruecker (San Diego, U.S.): My Linux Mint Tribute
Aug 23, 2024

Scott Ruecker (San Diego, U.S.): How I Turned My Chromebook Into A "Mintbook"
Jul 08, 2024

Scott Ruecker (San Diego, U.S.): Adventures With My New Chromebook
Jun 10, 2024

Scott Ruecker: My Linux Laptop
May 08, 2022

Scott Ruecker: Laptop Dual Boot Project: Part 2
Nov 30, 2021

Scott Ruecker: Laptop Dual Boot Project
Nov 30, 2020


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