PoC: Support multiple instances of PgBouncer on a single node as nested services
What does this MR do?
This MR enables Omnibus to run multiple instances of PgBouncer on a single node using the same port number. It uses so_reuseport
and runs multiple pgbouncer
processes, each with its own configuration.
Users can enable this feature by setting pgbouncer['number_of_instances']
to the desired number of pgbouncer
instances (default is 1
).
They can control the service using gitlab-ctl stop|start|restart|hup pgbouncer
to signal all instances. Controling individual instances is not supported.
Note that gitlab-ctl tail pgbouncer
shows the collective logs of all pgbouncer
processes as separate files.
In comparison to !5756 (closed), this MR uses nested runit service units for individual pgbouncer instances. In order to do this it applies minor changes to runit
cookbook.
How to test?
- Install the package or use the Docker image from build pipeline.
- Setup a a node with Pgbouncer
- On the Pgbouncer node, set
pgbouncer['number_of_instances'] = n
wheren > 1
. - Use
gitlab-ctl status|tail|stop|start|restart|hup pgbouncer
to interact with the services. - Start killing
pgbouncer
processes one by one while monitoring thepgbouncer
service unit logs. You can see that they will be restarted. Usegitlab-ctl restart pgbouncer
fails.
Related issues
Related to #4796 (closed)
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
-
Merge Request Title, and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com -
Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks -
trigger-package
has a green pipeline running against latest commit
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -
Documentation created/updated -
Tests added -
Integration tests added to GitLab QA -
Equivalent MR/issue for the GitLab Chart opened