How a Ryan Gosling Tweet Forced a Flask App to Handle 10,000 Requests Per Second
A developer's small analytics backend, built with Flask on a 512MB Heroku dyno, collapsed under a sudden surge of 50,000 concurrent users after Ryan Gosling tweeted a link to their side project. The root cause was Flask's default thread-per-request model, which caused unbounded memory growth and repeated out-of-memory crashes on the limited server. The developer rebuilt the system using asynchronous I/O, a bounded SQLite connection pool, and WAL (Write-Ahead Logging) mode to safely manage concurrency without adding hardware. Key architectural constraints included capping connections at 200, setting fast failure timeouts, and offloading non-critical work to the client browser. The redesigned system ultimately sustained 10,000 requests per second on just 8GB of RAM, serving as a practical case study in resource-constrained backend engineering.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in