"How 500 HN users crashed my 2GB server in 60 seconds – postmortem
1–7 of 7 posts
Re: "How 500 HN users crashed my 2GB server in 60 seconds – postmortem
#2Re: "How 500 HN users crashed my 2GB server in 60 seconds – postmortem
#3500 concurrent users is not "production traffic".
Nothing to learn here, apart from: this could've been one server engine, one database, and vanillajs. Let's repeat our usual mantra before building anything: you're not building current(!) Facebook/Netflix from scratch, stop having 10+ product dependencies, 20 services and 6 different languages in your toy project.
Re: "How 500 HN users crashed my 2GB server in 60 seconds – postmortem
#4tldr: vibe overengineered and badly configured platform crashes under minimal load. 500 concurrent users is not "production traffic". Nothing to learn here, apart from: this could've been one server engine, one database, and vanillajs. Let's repeat our usual mantra before building anything: you're not building current(!) Facebook/Netflix from scratch, stop having 10+ product dependencies, 20 services and 6 different…
Re: "How 500 HN users crashed my 2GB server in 60 seconds – postmortem
#5tldr: vibe overengineered and badly configured platform crashes under minimal load. 500 concurrent users is not "production traffic". Nothing to learn here, apart from: this could've been one server engine, one database, and vanillajs. Let's repeat our usual mantra before building anything: you're not building current(!) Facebook/Netflix from scratch, stop having 10+ product dependencies, 20 services and 6 different…
Fair point on the server being undersized. Stack is actually just Node
In those days, this 2GB server would have been a dream to have and probably had moved the needle to 20k, 50k or whatever the limit is. You only get problems with 500 connections on a modern machine if you are really really bad at handling each request.
Re: "How 500 HN users crashed my 2GB server in 60 seconds – postmortem
#6Earlier quoted context omitted.
Fair point on the server being undersized. Stack is actually just Node
In the 90s, people thought about the c10k problem, which is how to handle 10000 connections. In those days, this 2GB server would have been a dream to have and probably had moved the needle to 20k, 50k or whatever the limit is. You only get problems with 500 connections on a modern machine if you are really really bad at handling each request.
Re: "How 500 HN users crashed my 2GB server in 60 seconds – postmortem
#7Earlier quoted context omitted.
In the 90s, people thought about the c10k problem, which is how to handle 10000 connections. In those days, this 2GB server would have been a dream to have and probably had moved the needle to 20k, 50k or whatever the limit is. You only get problems with 500 connections on a modern machine if you are really really bad at handling each request.
You are right, the server handled connections fine. The issue was a single unindexed correlated subquery blocking the entire PostgreSQL connection pool for 13 minutes. We live and learn.