NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Senior1 view

How do you scale web application workers (for example, in FastAPI or Django), and which server did you use on your project?

Practice

AI answer

First, I separate the web application from background work: I send long-running tasks to a queue (for example, Celery with Redis or RabbitMQ) and run the workers separately. I configure their number based on CPU, memory, workload characteristics, and queue latency; then I scale horizontally by adding instances. Resource limits, graceful shutdown, health checks, monitoring, and idempotent task processing are also needed. Django projects often use Gunicorn with a WSGI/ASGI worker class; FastAPI projects use Uvicorn, often managed by Gunicorn or running in a container with multiple replicas. You should name the specific server and setup used in your project, without claiming experience with a stack you don’t know.