chore!: increase pg connection defaults #21572
Closed
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.
Context:
We noticed by observing
go_sql_in_use_connectionsandgo_sql_idle_connectionsthat we were saturating the max connections even in our modestly-sized dogfood installation.After landing #21403 we conducted some experiments to see where the sweet-spot would be, and we landed on 30 max open connections and 15 idle connections per coder replica.
This will be the new default to give operators the best chance of a smooth experience when using the product.
However, operators who have existing installations need to pay close attention when upgrading to v2.30, which this change will be included in. Postgres'
max_connectionsdefaults to100, and with a 10-replica installation they might've gotten away with not tuning this value with each replica only using 10 connections.Release manager: we need to call this change out prominently in the changelog.
docs/tutorials/best-practices/scale-coder.mdcontains some scaling guidance for these values.