Skip to content

PoC: Support multiple instances of PgBouncer on a single node

Hossein Pursultani requested to merge 4796-muliple-pgbouncer-1 into master

This is a proof of concept. DO NOT MERGE

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.

How to test?

  1. Install the package or use the Docker image from build pipeline.
  2. Setup a a node with Pgbouncer
  3. On the Pgbouncer node, set pgbouncer['number_of_instances'] = n where n > 1.
  4. Use gitlab-ctl status|tail|stop|start|restart|hup pgbouncer to interact with the services.
  5. Start killing pgbouncer processes one by one while monitoring the pgbouncer service unit logs. You can see that they won't be restarted unless all of them are killed.

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
Edited by Hossein Pursultani

Merge request reports