From 5a7ef0fab1cbf9d6fdc64dd3cc0da08474b63155 Mon Sep 17 00:00:00 2001 From: "posthog[bot]" <206114724+posthog[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:35:51 +0000 Subject: [PATCH] fix: set explicit max_connections floor in postgresql.conf The template left max_connections and superuser_reserved_connections commented out, so the box fell back to the compiled-in stock 100 slots. The database-optimizations service that sizes the box writes generated-optimizations.conf, but it runs with ExecStart=- and ignores its own failures. When optimize db fails, the placeholder file stays empty and the ceiling silently stays at 100. Set an explicit max_connections floor of 200. The generated-optimizations.conf include sits later in the file, so a successful optimize run still overrides this value with box-appropriate sizing. The floor only applies when sizing is absent, which removes the stock-100 failure mode. Generated-By: PostHog Code Task-Id: 66ac8c8b-209d-4387-af52-a7e9cc83e447 --- ansible/files/postgresql_config/postgresql.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index 5d42370686..5309760a0f 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -62,8 +62,8 @@ listen_addresses = '*' # what IP address(es) to listen on; # defaults to 'localhost'; use '*' for all # (change requires restart) #port = 5432 # (change requires restart) -#max_connections = 100 # (change requires restart) -#superuser_reserved_connections = 3 # (change requires restart) +max_connections = 200 # floor above the stock 100; generated-optimizations.conf below raises this to fit the box (change requires restart) +superuser_reserved_connections = 3 # (change requires restart) #unix_socket_directories = '/tmp' # comma-separated list of directories # (change requires restart) #unix_socket_group = '' # (change requires restart)