News for hackers. Stuff that matters.

Show HN: Don't get slashdotted when your link hits the HN front page

I'm sick and tired of clicking interesting links on the HN front page, only to get a spinning loader and waiting 10+ seconds for nothing. I'm not going to take the time to find the Google cache for your site, so if you want me to read what you wrote, please consider doing at least the bare minimum to keep your site running when I visit:

1. Use a static page cache / serve static HTML. Either use something like Varnish, or if you don't want to configure it or you're on a shared host, use one of the following extensions/techniques to statically cache pages:

  - Wordpress: http://wordpress.org/plugins/wp-super-cache/
  - Drupal: https://drupal.org/project/boost
  - Joomla: http://extensions.joomla.org/extensions/core-enhancements/performance/cache/13155
  - Rails: http://guides.rubyonrails.org/caching_with_rails.html
Even better, use something like Jekyll (http://jekyllrb.com/) for static pages by default. There are many good static site generators that will let your site stay nimble even with hundreds of requests/second on a shared host!

2. For Apache, set KeepAliveTimeout to something sane, like < 5 seconds. You don't all your active connections clogged up while 50+ people are simultaneously visiting.

3. Don't add a bunch of huge images—unless they're hosted on a CDN/other domain, and/or you have the server bandwidth and resources to serve such images.

It's great that you want to control your own content on your own domain/host, but please try to keep up with the moderate levels of traffic the front page of HN throws at your server!

( 4 comments | 12 points | on HN )
Re:Show HN: Don't get slashdotted when your link hits the HN... by frankacter on Monday August 26, 2013 @12:08AM (#6275148)
I'd add on to this to consider using CloudFlare and setting up page rules to cache static HTML so the majority of your anonymous reader traffic is served from their servers and not yours.
Re:Show HN: Don't get slashdotted when your link hits the HN... by Sealy on Tuesday August 27, 2013 @01:40AM (#6281669)
I second that frankacter. I use CloudFlare and even at its lowest option is a godsend. For those that are unaware it is a CDN with a number of great benefits:

1. It cuts your server bandwidth usage in half or better for flat content

2. It accelerates content delivery around the world

3. Provides protection

Disclosure: I am a VERY happy customer of their services

Re:Show HN: Don't get slashdotted when your link hits the HN... by geerlingguy on Monday August 26, 2013 @07:20AM (#6276306)
Another very good, and free, option!
Re:Show HN: Don't get slashdotted when your link hits the HN... by chidevguy on Monday August 26, 2013 @09:49AM (#6276977)
Great suggestions! I'd also add Octopress (http://octopress.org/), which is built on Jekyll and works well with Amazon CloudFront (haven't tried CloudFlare, but I'd imagine that works just as well).