A guide for apps on FastAPI + SQLAlchemy 2 (async) + asyncpg sharing one PostgreSQL server on Ubuntu. It was written after putting a production app behind PgBouncer, and it includes the problems hit along the way.
PostgreSQL runs one OS process per connection (~5–10 MB each). max_connections defaults to 100 for the whole server, and every app's connection pool counts against it. Ten Celery workers, each holding a SQLAlchemy pool, add up quickly. On a shared box, one app spiking means another app gets too many connections.