Skip to content

db: keep warm connections for ten minutes - #37

Merged
Uzaaft merged 1 commit into
masterfrom
perf/pool-idle-timeout
Nov 17, 2026
Merged

Uzaaft merged 1 commit into
masterfrom
perf/pool-idle-timeout

Conversation

@Uzaaft

@Uzaaft Uzaaft commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

The pool closed any connection idle for 60 seconds. sqlx applies that
to the minimum connections too, then reconnects at once to restore the
minimum, so an idle service kept replacing its warm connections every
minute. In production the replica pool, used only by reporting reads,
opened five connections a minute around the clock.

Raise the idle timeout to ten minutes. Connections opened for a burst
are still returned afterwards, and the warm ones are replaced at most
once per period rather than once a minute.
@Uzaaft
Uzaaft merged commit 9eb93f6 into master Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant