PostgreSQL tuning
The PostgreSQL image tunes PostgreSQL to its container every time it starts. Enter the container's limits and volumes below to see the settings the server will run with, where each one comes from, and the warnings the image prints. Running a server of your own? Download the same settings as one include file. The page address keeps your inputs, so you can share a view or come back to it later.
--memory, or mem_limit in Compose.--cpus, rounded up.--shm-size. Docker gives 64 MB unless told otherwise.TS_TUNE_MAX_CONNS, 200 when empty.TS_TUNE_MAX_BG_WORKERS, 64 when empty. One for each tenant database.More inputs
Variables and an argument that replace what the entrypoint reads from the container.
8GB. The memory warning still compares with the container's limit.50GB.-c max_connections= after the image name. It wins over TS_TUNE_MAX_CONNS.The tuner prints: The server reads postgresql.conf, where the tuner writes, then the policy files, then andromeda-derived.conf, then its command line. The last value it reads wins. Each line names where its value comes from and what it replaces. This is the first start on a new data directory. Every start tunes again over what the last one wrote, and keeps an earlier value that is within 5 percent of the new one. The lines the tuner writes into postgresql.conf, the file the entrypoint writes beside it, and the policy files in The entrypoint runs These start a new data directory with the limits and settings above. The data and WAL volumes are as large as the filesystems they live on.Recommendations based on 4.00 GB of available memory and 2 CPUs for PostgreSQL 18Settings the server runs with
ALTER SYSTEM and -c flags after the image name win over every file here.For a server of your own
andromeda-tuning.conf holds these settings, shared_preload_libraries and the extensions the broker creates in each tenant database. Include it from the end of postgresql.conf on a PostgreSQL 18 server.The image's own files
/etc/postgresql/andromeda.conf.d, as the image holds them.timescaledb-tune with:--memory=4096MB--cpus=2--max-conns=200--max-bg-workers=64Run the image with these inputs