Best Image Hosting Scripts

How to Prepare for the “Reddit Hug of Death”

Image Sites Are Particularly Vulnerable.

As website owners, one of our dreams is hitting the big time. And yet, time and time again, website owners have reported the fact that their website becoming popular became an absolute nightmare. Why? In a few words, lack of preparation for huge spikes in traffic that crash your website’s server. This means that getting all those people to your website, which you’ve worked so hard for, ends up with them visiting a broken site…and moving on. What can we do to prevent this?

In a word? Preparation. There are some key factors that will ensure you can be prepared for a major surge in internet traffic. You can upgrade your hosting to VPS with reliable hosts like Arvixe, utilize cloud hosting features and save lots of bandwidth with image compression. These factors alone might be enough to save you. But we also need to understand why websites crash when there’s a huge surge in traffic.

The Reddit ‘Hug of Death’

reddit hug of death advice
Formerly known as the ‘Slashdot hug of death’, this phenomenon happens when an image, article, or video becomes a highly-viewed post on Reddit or another popular site.

What makes a site crash is the number of requests coming all at once. Every single visitor that visits your website from Reddit will make a request from your server. If you’re on a shared server (which is what most people start out with), you are sharing one server with thousands of other websites. So you are sharing the limited memory and bandwidth with other websites. And when you’re popular on Reddit, you can get hundreds of thousands of requests in the space of an hour.

That uses up a lot of memory.

So if you’re on a shared server, more often than not, your server will crash. And your hosting company will need to reboot the server, and it could be hours before your website goes live again. In order to prevent this, we need to ease the strain on that one particular server by 1) getting a more capable server, and 2) limiting the amount of memory used per visitor.

1. Getting a More Capable Server

This doesn’t just mean getting a more expensive hosting plan. Not all web hosts are created equal. You want a web host that uses solid-state drives (SSD) instead of regular hard drives. We mentioned Arvixe up above. Dreamhost is another host that switched over to SSD’s. These hard drives are faster and more efficient at handling requests. So your website will respond quicker and be able to handle more at once.

But that’s not all. You also need a host that can use cloud services to handle extra requests. Not all hosts do it. This means that, if there’s a traffic surge, the host will be able to utilize cloud servers to handle the extra requests. Again, Arvixe and Dreamhost are two hosts that use these cloud networks.

2. Minimize Memory Usage Per Visitor:

Minify and Compress all Images – When you were first starting out, you probably didn’t both with compressing images when you published them. But when your traffic starts to get bigger, you’ll soon realize the value in making your images as small as possible. If your image is 500kb of data, then a hundred thousand requests will add up to 500MB of data transferred. That’s a lot of memory and bandwidth! If you compress your images down to 100kb, then the same traffic will use only 100MB of data. That huge difference in memory usage could make the difference between your server crashing or not crashing.
If you’ve already added lots of non-compressed images to your site, you can downlaod a plugin like TinyPNG that will compress all your existing images. You only pay for the amount of bandwidth they use in compressing your images, which wasn’t much for us when we tried it. It compressed about 400 images and charged us $5. Not bad!

Enable ‘lazy load‘. Lazy loading of your images means that images won’t load on your page until the visitor scrolls down to view them. This means that for the ‘casual’ visitor that visits your website and immediately leaves, you won’t waste all your memory and bandwidth on them. If 40% of Reddit’s massive traffic immediately leaves before reading the whole article/post, then you can save a huge amount of bandwidth on the ‘real visitors’ that might turn into regular readers/customers.

For lazy load, some web hosts enable it by default on their servers (you’ll likely need to contact support to find that out for your particular web hosting provider). Many WordPress themes like Sahifa have lazy load embedded in their theme functionality. If not, then you can also download plugins that will enable lazy load on your server as well.

Conclusion: We’ve Saved You A Lot of Bandwidth!

You can’t prepare for every eventuality, but these factors will reduce your server load by 80% or more, and if you get a server than can handle a larger load (like SSD’s!) then you are well-equipped for any massive spikes in popularity that come your way.

Of course, now that your website can handle your content going viral, how are you going to capture those visitors into ongoing customers/fans? That’s something we’re not experts at. But it’s the next step on your journey. May we suggest experts like Pat Flynn and Leadpages (these are not affiliate links, they just seem to be really good at marketing).