Django production stacks commonly include Gunicorn or another WSGI/ASGI server, PostgreSQL, Redis, Celery, Nginx, and scheduled jobs. The framework itself is only one part of the capacity plan.
A small Django application can run on modest resources, but worker counts and background tasks should be based on measurement rather than generic formulas.
Key takeaways
- 2 GB is enough for many small Django apps.
- 4 GB is more comfortable with PostgreSQL, Redis, and Celery on the same VPS.
- Gunicorn worker count affects both concurrency and memory.
- Keep PostgreSQL close to the application.
- Background jobs may need independent scaling.
Django RAM sizing
Two gigabytes provides a practical starting point for a small application with a limited number of workers. Four gigabytes is easier when the server also hosts PostgreSQL, Redis, Celery, and monitoring.
Measure memory per worker under real traffic before increasing concurrency.
Gunicorn and ASGI workers
Worker count should reflect CPU, memory, request behavior, and whether the application is synchronous or async. More workers are not free because each process consumes memory.
Latency caused by slow database queries will not be solved by adding workers indefinitely.
Celery and Redis
Background tasks should leave the request path when they are slow or resource-intensive. Celery workers can run on the same VPS initially and move later when they compete with the web process.
Redis is commonly used as a broker or cache and should have enough memory headroom.
PostgreSQL and backups
Django applications often use PostgreSQL, which benefits from memory and consistent storage. Keep it close to the app and use database-aware backups.
A provider snapshot is useful but should complement, not replace, database backups.
Frequently asked questions
Is 2 GB enough for Django?
Yes for many small applications. Four gigabytes gives more headroom when PostgreSQL, Redis, and Celery share the server.
How many Gunicorn workers should I use?
There is no universal number. Measure CPU, memory per worker, request latency, and workload behavior.
Does Django need Redis?
No, but Redis is commonly used for caching, sessions, and Celery queues.
Should PostgreSQL run on the same VPS?
For small systems, yes. Separate it later when scale, isolation, or reliability requirements justify it.