Episode 18 showed you how to deploy with zero downtime, but a single server running 3 Gunicorn workers will hit its limit sooner or later: CPU saturates, requests queue up, and the statistics page gets slower and slower. This episode shows how to scale one step at a time — add workers, balance the load with Nginx, split off a read replica for PostgreSQL — and the signs that tell you when scaling is actually needed.
Step 1: Add Workers Before Adding Machines
Before buying another server, squeeze everything out of the one you have. The classic Gunicorn formula is two times the CPU count plus one, but that is only a starting point — measure the real CPU usage and response latency.…