Running multiple apps on one Postgres? I built an extension so one of them can't hog the whole server
Hey everyone, Like a lot of people here, I run a single PostgreSQL instance that several services share (Nextcloud, Gitea, Immich, whatever you have). It works great until one of them runs a heavy job and everything else crawls. So I built pg_qos , a PostgreSQL extension that lets you set limits per database or per user. You stay on one Postgres instance, but each app gets its own guardrails: sql ALTER DATABASE immich SET qos.cpu_core_limit = '2'; ALTER DATABASE nextcloud SET qos.max_concurrent_select = '20'; ALTER ROLE gitea SET qos.work_mem_limit = '64MB'; What you can limit: CPU cores a database or user can use (Linux) Number of queries/transactions running at the same time Queries per second (e.g. '100/1s' ) Memory per session ( work_mem ) Changes apply to already-connected sessions, so no app restarts are needed. It supports PostgreSQL 15–18, has .deb/.rpm packages for Debian 13, Ubuntu 24.04 and RHEL 10, and is GPL-3.0. Repo: github.com/appstonia/pg_qos Would love to hear if this is useful for your setup or if something's missing.