Aftermath of Hacker News

Last night, I wrote a blog post about a bad signup experience with Square, posted it to Hacker News, and left to get dinner. I wrote it so others who share my predicament might find it by searching the web and get some more information about how Square’s verification works. I didn’t expect very many people to care — the experience I described is an edge case that affects few users. I didn’t even optimize the PNGs.

For the first half hour, not much happened. But if your post can reach 25 points or so, it gets tweeted by a bunch of Hacker News bots. That’s when it starts to spread like wildfire.

In a short period of time, my site received about 15,000 requests, peaking at 10 or so requests per second. This is nothing for most larger sites. But my site is running on the equivalent of a netbook — could it handle the load?

Bandwidth reached over 6 megabits per second

In short, yes. There was a flurry of disk activity at the beginning, as Apache loaded some files for the first time. Then, since the site is lightweight enough to be completely cached in memory, physical disk usage dropped to a trickle of writes for the log files.

Disk usage is around 0.01 MB/s of writes

The CPU could’ve handled about 10 to 15 times the traffic without a problem. In fact, if Apache were better optimized for ARM, I could’ve used a Raspberry Pi to serve the site. (Had this been an uncached WordPress site, the server would’ve been toast.)

Total CPU usage is around 5 percent

Latency stayed below 200 ms for the most part.

Latency peaks around 8 PM at 220 ms

All in all, this was a pretty good stress test. I don’t have anything to worry about until Justin Bieber tries to sign up for Square.

Thanks for reading! If you’re enjoying my writing, I’d love to send you infrequent notifications for new posts via my newsletter. You’ll receive the full text of each post, plus occasional bonus content.

You can also follow me on Twitter (@kevinchen) or subscribe via RSS.