hn

Please, for the love of God(s)*(esses)*, consider what happens when your post takes off when it’s on HN, or Reddit, or hell, even Twitter. It may happen to anyone.

And it’s absolutely horrendous to see the “Error could not connect” page or just an infinite loading time. And worse yet, the top comment will probably be pointed at Google Cache or something. Making you not only lose out on traffic but creating a negative, shitty, reading experience for a user. Urgh. Blargh. Get rid of it.

The Problem

Outside of the obvious (massive amounts of traffic), the problem is that people often use vanilla WP install and often on Shared Hosting in order to write and distribute their content. You’d expect something more from technical people who have the solution within their reach.

A vanilla WP install can be heavy, especially after you add several plugins, have a custom WP theme and so on. Hell, even when I had my WP install super-optimized (on the WP side), no amount of W3TC caching could stop my server from being hammered into death (and getting banned by the host).

So the problems most people experience are:

  • using a shared host – shared hosts have various policies from killing off your site entirely until the traffic dies down to simply limiting all your resources
  • using un-cached WP or using WP-side caching (not good enough!)
  • getting too much traffic for WP to handle even with (WP) caching

The Solution

The steps are pretty easy to follow and should withstand whatever HN throws at you.

Get A VPS

I suggest using Digital Ocean because they’re easy to use and cheap as hell. For $5, you’ll get hosting miles better than any $4/month shared host. Make a “droplet” with the latest version of Ubuntu and you’re ready to get started.

Of course, you already have a blog with content so how the hell do you move it over?

Use Genesis Skeleton for WordPress

disclaimer: I work on this tool heavily.

Genesis Skeleton is a workflow for WP development but it also has a few neat tricks up its sleeve:

  • it’s great for backups
  • it sets up a rugged production environment with: Varnish caching, Apache prefork tuning, version controlled and multiple environment
  • due to its Rsync and DB sync capabilities, it makes moving sites super easy.
  • vagrant support allows for awesome local development

So get the generator, move your site over to the system and provision your droplet. Your site will be the boss.

Is there anything difficult in this process? Yeah, there are some things you’ll need to do: get a bitbucket account for free private repos (or use Github with a subscription), get SSH access for your shared host (or start fresh), and have Node+Ruby installed (not a big deal for a dev/tech person).

Extra awesome steps

Here are a few extra steps that will also help:

  • Get cloudflare setup. It provides rudimentary caching
  • if you have the cash, pay for a CDN. I recommend MaxCDN (from personal experience)
  • resize your Droplet before posting on HN to a larger (more expensive droplet) and reprovision with Genesis Skeleton for optimized Varnish and Apache prefork tuning. If your post doesn’t take off, resize and reprovision again.

Good luck posting!

What kind of improvements can I expect?

My site used to choke after having about 100-200 people on there at once (with visible slowdowns). Now, it can hold several thousand at a time without an issue. I think that’s a significant increase in performance.