Tools

App memory sizer

Will your app fit in a 128, 256 or 512 MB container, and what does its database pool cost?

Your app

Pick the runtime and how your app connects to the database.

Measured with: FastAPI + uvicorn.
Each worker is a separate Python process with its own copy of your code and its own DB pool.
On top of a hello-world app. Read it from docker stats of your own app, minus the base above.
For request spikes, caches and garbage collection. Your choice.

App container

2 workers: 87.0 MiB measured idle + 80.0 MiB your code + 25% margin = 209 MiB

128 MB
163% · does not fit
256 MB
82% · tight
512 MB
41% · fits

Database connections

10 connections × 3.36 MiB = 33.6 MiB on the PostgreSQL server. Running PostgreSQL 18 yourself in a container: 53.5 MiB base + connections = 87.1 MiB.

256 MB
34% · fits
512 MB
17% · fits
1 GB
9% · fits

Connections use memory on the database server, not in your app container. Sorts and hash joins add up to work_mem (4 MB by default) per operation while a query runs.