Implement multiple PgBouncer instances on a single node
Background
With the findings of the research in #4796 (closed), we can now proceed to an implementation for supporting multiple PgBouncer instances on a single node, leveraging so_reuseport
configuration of PgBouncer 1.12.
This will help us to address the single core limitation of PgBouncer. For further discussion please refer to #4796 (closed).
Proposal
Based on our assessment, using nested runsvdir
to run multiple instances of PgBouncer as runit services seems to be the best option forward. This is presented in !5766 (closed).
For a discussion on the alternative approach and its limitation is please refer to !5756 (closed).
Acceptance criteria
-
Users specify the number of PgBouncer instances with a configuration attribute, e.g. pgbouncer['number_of_instances']
, which by default is1
. -
Other PgBouncer configuration attributes do not change (unless different configuration for different instances is intended, see "Nice to Have"). -
gitlab-ctl
service commands for monitoring and managingpgbouncer
service do not change. -
Any change to PgBouncer configuration is reflected in all PgBouncer instances. Although the order of changes is arbitrary.
Nice to Have
-
Each instance can use a different configuration, for example different port numbers. At this point the scope of this feature is not determined and individual configuration items must be defined first.