3 ms·
genuinely amazing, is there a writeup on this?
by Hammershaft 3y ago
genuinely amazing, is there a writeup on this?
- tiffanyh 3y agoI’ve never seen a full blown write up. but dang references it in a handful of comments he’s posted.
- bjoli 3y agoIs it? HN is mostly static content. Ten years ago I wrote a simple web application using twister (python) that did well over a thousand requests per second. If we count just handling requests (and not churning out much data or doing anything fun processing) japronto for python claims to handle something like 1.2 million req/s on a single thread.
- hajile 3y agoThe most frequently access parts of the site are always in flux with users constantly adding, removing, and editing content. I don’t know how you could statically generate that. At most, you could memoize the parts of the page that haven’t changed yet and return them without a complete lookup, but keeping that in synch with a database is not an easy problem.
- nkjnlknlk 3y agoHN doesn't have that much traffic so it's easier than you might think!
- bjoli 3y agoYou could regenerate the start page every 5s and comment pages whenever you need (new, edited or deleted comments) or every request if there has been more than 30s since it was last updated. That would leave the serving to some of the applications being good at that (varnish?). Finding the right heuristic regarding page regeneration might take some tweaking, but the amount of generating you have to do is small enough not to bother any single threaded program.