Live data from Hacker News

Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

news.ycombinator.com

11–20 of 32 posts

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#12
post #5

This depends almost entirely on what you're doing. If the site at issue isn't dynamic, my suggested action is probably "do nothing", because being frontpaged by HN is not going to tax any computer routinely used to serve web pages in 2017. If you genuinely have problems, then the question boils down to "What is going to break first?" and whether it makes more sense to harden that or temporarily disable it. If you're…

Switching from mod_php to php-fpm + proxy-fcgi (ie still with Apache) and then using the event mpm will help a lot.

Putting varnish in front of any web server will help more.

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#13
post #5

This depends almost entirely on what you're doing. If the site at issue isn't dynamic, my suggested action is probably "do nothing", because being frontpaged by HN is not going to tax any computer routinely used to serve web pages in 2017. If you genuinely have problems, then the question boils down to "What is going to break first?" and whether it makes more sense to harden that or temporarily disable it. If you're…

Absolutely nothing. I've had my personal site reach the top a couple of times and its been totally fine each time. My site is static and runs on a $5 Digital Ocean droplet. The traffic barely even made it blink.

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#14
post #5

This depends almost entirely on what you're doing. If the site at issue isn't dynamic, my suggested action is probably "do nothing", because being frontpaged by HN is not going to tax any computer routinely used to serve web pages in 2017. If you genuinely have problems, then the question boils down to "What is going to break first?" and whether it makes more sense to harden that or temporarily disable it. If you're…

I've had dynamic content reach front page of HN and same thing: node (single threaded without the cluster module) handles it just fine.

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#15
post #8

Caching. I used to be responsible for sites involved with the Olympics. For 100 weeks traffic was next to nothing. For the two weeks preceding and two weeks during the games there really was spike after spike after spike. The site basically used nginx with SSI to serve up static content that was generated from Rails. Almost everything we could make static was. We rsync'd files every minute or so across the cluster an…

Did you really use Rync? I figured there might be something more modern.

Yeah this was back in 2010-ish.

I explored a lot of distributed file systems, was really looking for something that would share files across the cluster once generated by one node. NFS, Ceph, GlusterFS, GridFS, some others.

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#16
post #5

This depends almost entirely on what you're doing. If the site at issue isn't dynamic, my suggested action is probably "do nothing", because being frontpaged by HN is not going to tax any computer routinely used to serve web pages in 2017. If you genuinely have problems, then the question boils down to "What is going to break first?" and whether it makes more sense to harden that or temporarily disable it. If you're…

Switching from mod_php to php-fpm + proxy-fcgi (ie still with Apache) and then using the event mpm will help a lot. Putting varnish in front of any web server will help more.

> Putting varnish in front of any web server will help more.

This has been my goto implementation because it can be rapidly deployed. Shameful plug: I've built Cachoid [0] for this very reason. It's a Varnish as a service platform and you can get up and running within 10 seconds.

[0] https://www.cachoid.com

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#18
post #13
post #5

This depends almost entirely on what you're doing. If the site at issue isn't dynamic, my suggested action is probably "do nothing", because being frontpaged by HN is not going to tax any computer routinely used to serve web pages in 2017. If you genuinely have problems, then the question boils down to "What is going to break first?" and whether it makes more sense to harden that or temporarily disable it. If you're…

Absolutely nothing. I've had my personal site reach the top a couple of times and its been totally fine each time. My site is static and runs on a $5 Digital Ocean droplet. The traffic barely even made it blink.

Just realized that my app responded to the top comment rather than the post itself.

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#19
Happened to me with an article of mine.

It got to be 3rd at the most, if I remember correctly.

I got 300 people at the same time for about 10 hours, then high but not crazy traffic for 2-3 days after that.

300 people at the same time is not a lot.

I had a WordPress website with no cache on a dedicated VPS (but nothing crazy), and neither the CPU nor memory got that busy. 300 people are about 1 person/second, 2 max. That's not a lot of load for a server.

Re: Ask HN: How would you handle a large traffic spike (eg. being frontpage on HN)?

#20
My company did some email marketing that would spike traffic to 50,000 visitors in 30-60 mins and Wordpress MySQL would go nuts. Who knows how many horrible plugins marketing had in there but first go to for me was varnish, then cloud flare then final awesome fix was swapping everything to static HTML that we crawled every night ourselves from our own htaccess blocked Wordpress. Only thing that had to be dynamic /do related was the contact form.
Post reply on HN