Increase Website Speed & Cut Bandwidth Costs for FREE!

Several months back I took my wife and five children on a 7 day Disney cruise (I *HIGHLY* recommend it by the way, and I’m a hard person to please :) ). Whenever I go on vacation the first thing I take care of is making sure that I have internet access. Thankfully, I was able to use my Verizon MiFi card while in most ports, but while at sea I had to use Disney’s on board satellite internet. It was extremely slow.

This got me thinking of how I could best increase the internet speed for our clients that have slow internet connections at no cost to them. I decided on using mod_deflate. I had used mod_gzip in the past (Almost 10 years ago) so I was familiar with how it all worked and it was simple to set up. Mod_deflate basically takes certain types of files and compresses them at the server level and then sends those smaller files to you. Images, zip files, etc don’t compress well (And so we don’t compress these, but HTML files, javascript files, css files, etc compress very well. Often we see 80% compression levels on those type of files. These files are then decompressed on the client side automatically and used. This is all transparent to the user, except that download/page load times are much faster for the user (10-25% faster).

However, there is a severe problem with using mod_deflate that no one seems to have solved. Using mod_deflate requires *significant* CPU usage on the server to use. The problem is that often CPU resources are maxed out. If you use mod_deflate while the CPU(s) are maxed out then the servers become even slower and all websites on the server will appear very very sluggish. For this reason most web hosting companies don’t use mod_deflate, and for good reason.

However, at Bluehost/Hostmonster we have a great solution for this problem! Some of you may have read a previous blog post where I mention that Bluehost/Hostmonster have a proprietary CPU protection system. Using, this system we track CPU usage in realtime. We then wrote a patch to the Apache web server (This is what serves your websites to your browser) that interfaces with our CPU protection system. This patch checks our CPU usage twice a second and if CPU usage exceeds a certain threshold then we temporarily suspend mod_deflate. When there are unused CPU cycles then it reenables mod_deflate. By implementing it this way we get all the benefits of mod_deflate with none of the detriments of excessive cpu usage causing slowdowns.

The first full day we ran this it lowered our bandwidth consumption about 600 Mbits a second (With very conservative settings). When we run it with aggressive compression we save over 1 Gig/s of sustained bandwidth. That is considerable savings/speedup for something that took about 4 days to develop, test, and deploy!

Now, next time our family goes on a cruise Bluehost/Hostmoner sites will appear much faster!

Thanks,
Matt Heaton / Hosting by Bluehost.com

52 Responses to “Increase Website Speed & Cut Bandwidth Costs for FREE!”

  1. Zoro says:

    That is company start cry after you use there 200 gb bandwidth and 10 gb space what a looser company delete all negative comments only keeping positive shame on you moderator runer of this blog

  2. [...] shoot from there. Because its not a server I manage, I did a quick Google search and found this. Basically it says they wrote a cool way to un-deflate when the shared server is busy. I [...]

Leave a Reply