Saving bandwidth with mod_deflate


While playing around with mod_deflate this week, I began to wonder how much bandwidth would be saved by enabling mod_deflate on a busy production site. To get a better idea of the bandwidth savings, I developed deflate-stats.pl:

$ deflate-stats.pl /var/tmp/apache/logs/deflate_log

Processed logfile /var/tmp/apache/logs/deflate_log

Total number of HTTP requests : 177934
Total number of HTTP requests deflated : 150511
Total output bytes by mod_deflate : 327.16 Megabytes
Total input bytes to mod_deflate : 14.15 Gigabytes
Total bandwidth saved by mod_deflate : 13.83 Gigabytes (97%)

Average request size : 98.55 Kilobytes
Average # bytes saved per request : 96.32 Kilobytes

Requests Total Bytes Requested Bytes Actually Sent Ratio URI
94506 13.90 Gigabytes 298.05 Megabytes 97 /nada.html
28007 41.24 Megabytes 13.46 Megabytes 67 /doc.txt
27998 206.13 Megabytes 15.65 Megabytes 92 /feedback.txt

If you are paying for each byte of transit, I highly recommend testing out the awesome mod_deflate module. mod_deflate should be able to speed up rendering time for dial-up users, and could lead to a reduction in monthly circuit costs.

This article was posted by Matty on 2005-12-23 14:32:00 -0400 -0400