fix: set explicit max_connections floor in postgresql.conf - #1
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix: set explicit max_connections floor in postgresql.conf#1posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix — server-side capacity floor for Postgres connection slots.
What is the current behavior?
ansible/files/postgresql_config/postgresql.conf.j2leftmax_connectionsandsuperuser_reserved_connectionscommented out, so the box fell back to the compiled-in stock 100 slots.database-optimizationsservice sizes the box by writinggenerated-optimizations.conf, but it runs withExecStart=-and ignores its own failures. Whenoptimize dbfails, the placeholder file stays empty and the ceiling silently stays at 100 — no floor.What is the new behavior?
max_connections = 200floor.generated-optimizations.confis included later in the file, so a successfuloptimize dbrun still overrides the value with box-appropriate sizing. The floor applies only when sizing is absent, which removes the stock-100 failure mode.Additional context
max_connections:pool key inyork_factory/config/database.yml(ActiveRecord expectspool:) andpool: 100in two other apps — which lives in application repositories not present here. Those pool trims must land separately.setup-supabase-internal(nixpkg_mode: true), which does uncomment thegenerated-optimizations.confinclude at build time. So the fragility is not the commented include but the swallowedoptimize dbfailure that leaves the box at stock 100. An explicit floor is resilient to that failure, so I chose it over touching the already-effective include.Created with PostHog Desktop from this inbox report.