8 ms·
Note that HN, a top-1000 site in the US, runs on a single box via a single racket process. "The key to performance is elegance, not battalions of special cases
by sillysaurus3 8y ago
Note that HN, a top-1000 site in the US, runs on a single box via a single racket process.
"The key to performance is elegance, not battalions of special cases."
- nlawalker 8y agoHeh, elegance like "There is a story on the front page getting lots of attention, please log out so we can serve you from cache."
- tambourine_man 8y agoAdmittedly, that’s very rare.
- nlawalker 8y agoI know, just a good natured poke :) Plus you could probably take that comment at face value - making use of web caching is definitely an important tool when building a large scale system.
- copperx 8y agoWhy is caching out of the window when logged in?
- dmoy 8y agovotes, things to hide, etc all change the page and prevent serving everything wholesale out of cache I'm not actually sure, just guessing...
- paulddraper 8y agoIt's a page-level cache, and your view on a page depends on username, hidden submissions, point counts, etc.
- toomuchtodo 8y agoWhen your queue is full, back pressure.
- justicezyx 8y agoThis is elegance. Balancing between user experience and cost.
- hinkley 8y agoElegance like "The entire site is a giant nested table in 2018"
- dozzie 8y agoAnd what exactly is wrong about that? Its loading and rendering speed? Or that it works in text mode?
- tw1010 8y agoWhile I agree with you, a lack of knowledge about this stuff will unfortunately not help you pass any interviews.
- eanzenberg 8y agoDisagree! Myself (and I hope most companies) will jump at the devs who build simple solutions that work.
- rhizome 8y agoSometimes it's a good idea for a sysadmin to know how to decompose something complicated into something simpler.
- moduspol 8y agoHN has the luxury of being able to make few high level changes over years, though. It might be tougher to maintain that single box elegance and performance if they were adding new features every month or two (which is much more applicable to the rest of us).
- pasta 8y agoI don't understand this comment. Why should adding features make an app crumble on a single server? I think the point is that good software is able to serve a lot of users on a single server. A great example imho is Blender. Features are added constantly but because the software is modular it doesn't have any impact on the overall performance. Today the problem is that adding features means: adding the latest and greatest lib while having absolutely no idea about the inner workings. Yes it takes time to write your own libs. But when performance is an issue you will either have to write your own lib or take one that is good and tested.
- moduspol 8y ago> Why should adding features make an app crumble on a single server? It's not inherent, but obviously as you have more developers working on more and more things independently, each with different needs, tolerances, and deadlines, it becomes increasingly unreasonable to presume it can all be managed well on a single box. If they went and added chat, or Twitter-like features, or subreddits, or similar, it might be a lot tougher to keep it all on a single box. It's a lot easier when we're all looking at the same top 30 stories, and pretty limited in how we interact with them and each other.
- UncleEntity 8y ago> A great example imho is Blender. Features are added constantly but because the software is modular it doesn't have any impact on the overall performance. As someone who used to hack on Blender all I can say is it's a big ball of inter-dependent modules all with interlocking dependencies. The only thing that really keeps it manageable is the strict adherence to MVC which, I suppose, does make it modular.
- 8y ago
- deleted 8y ago[deleted]
- driverdan 8y agoWhich is great for HN but is not the solution for everyone.
- skolemtotem 8y agoA single box?! Do we know its specs?
- swarnie_ 8y agoPentium II with 64mb of Ram is my assumption.
- mabbo 8y agoIf it runs on a PII, but provides as much value as it does to all of us, I call it a very successful product.
- sillysaurus3 8y agoAs of 2015: https://news.ycombinator.com/item?id=9222006 https://news.ycombinator.com/item?id=9222006 FreeBSD 10.1 Nginx 1.7.10 Racket 6.1.1 with some HN and FreeBSD specific patches. 2x 3GHz Intel Xeon-IvyBridge (E5-2690-V2-DecaCore) 8x16GB Kingston 16GB DDR3 2Rx4 SuperMicro X9DRI-LN4F+_R1.2A Adaptec 71605 9x 1000GB Western Digital WD RE4 2x 200GB Smart XceedIOPS SSD
- a012 8y agoThis "single box" has a lot of computing units as on AWS EC2.
- nostrademons 8y agoThat should tell you a lot about the price you pay for using AWS.
- rhizome 8y agoThe figure I saw around maybe 2015 was that AWS (maybe Heroku) is 10x more expensive and bare metal is 10x more efficient/faster, lending a 100x difference in price-performance. Both factors are probably larger nowadays.
- Quarrelsome 8y agowhen was the last time it was changed? I'd imagine Craigslist is also quite efficient.
- GhostVII 8y agoHN is relatively easy to optimise though - there are only a few stories with high traffic, so if you have good caching the load on the back end can be very low. It's more difficult to do that with something like github where the users are spread across millions of repos.
- deleted 8y ago[deleted]
- paulddraper 8y ago> runs on a single box via a single racket process Incomplete. They are fronted by one of the largest CDNs in the world, on whom they rely for most traffic. Well, I actually don't know the numbers, but I do know that for popular posts HN admins (a) try to break the conversation up over multiple posts and (b) plead with users to log out so as to allow Cloudflare to handle the load. The biggest lesson HN teaches for designing large scale systems is "use a large scale system someone else has already designed".
- deleted 8y ago[deleted]
- weavie 8y agoWhat would happen if the cleaner accidentally unplugged that box? Would it failover to a backup? I guess the advantage of not relying on your site for profit is that you can afford to not worry about a bit of down time so much...
- NhanH 8y agoHacker News has been up and running for like 10 years now, isn’t it? Instead of hypothetical question, I guess we have actual data on the uptime for such question.
- eanzenberg 8y agoI think redundancy is much easier if the thing being made redundant is extremely simple? Imagine having to manage 50 different services (and sometimes servers) as opposed to 1 machine.
- lossolo 8y agoI am running top-1000 site in one of EU countries on one 4 core machine with 20-30% load. Around 1000 http/https reqs/s. Most of those requests do couple of postgres reqs (read and write) and couple of redis reqs. Elasticsearch - for searching/recommendations Redis - hot data (certain data is only kept in redis) Postgres - for the rest of data Clickhouse - analytics Most of the system is written in Go. Whole system was tuned for performance from day one. As to latency, data from the last 21 million requests today: p99: 17.37 ms p95: 6.86 ms avg: 2.37 ms
- tmaly 8y agoare you using any specific Go web framework or just the standard library?
- lossolo 8y agoI am using fasthttp[1] 1. https://github.com/valyala/fasthttp https://github.com/valyala/fasthttp
- digikata 8y agoIs postgres on the same machine or on a separate one?
- lossolo 8y agoSame machine, everything is on the same machine (dedicated server aka bare metal, not vps/cloud).
- digikata 8y agoThanks for the reply! May I ask how far you go with respect to reliability/availability? Do you have a live replicated server on stand by or just replicate a log stream elsewhere, something else?
- mullen 8y agoHN is only a top-1000 for the US, not the world and it barely makes it into the top-1000 for the US. When HN breaks into the top-100 for the world, let us know what it runs on.
- e12e 8y agoA better example might be stack overflow that ran on four(?) boxes for a long while (two sql server s, two iis/dot.net application/web servers). They now have a few more bits: https://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/ https://nickcraver.com/blog/2016/02/17/stack-overflow-the-ar...
- deleted 8y ago[deleted]