Add docs for troubleshooting connection problems due to two DB connections
- max_replica_pools in https://docs.gitlab.com/ee/administration/postgresql/database_load_balancing.html
- https://docs.gitlab.com/ee/administration/postgresql/pgbouncer.html#fine-tuning
- There is also https://docs.gitlab.com/ee/development/database/client_side_connection_pool.html
I would suggest adding links to above in a page like https://docs.gitlab.com/ee/administration/postgresql/multiple_databases.html
Steps used to test
- The MR is here: omnibus-gitlab!6663 (merged)
- If you don't have a project already, create a GCP project with https://about.gitlab.com/handbook/infrastructure-standards/realms/sandbox/#how-to-get-started
- Go to your GCP project in console.cloud.google.com. Note it may take 5-10 for your new GCP project to appear in the projects list
- Create a new VM instance. GitLab recommends 4GB memory and 2 CPU, so I chose
Machine type: n2-standard-4
. I recommend having Ubuntu 22.04 (Ubuntu 22.10 is not supported yet). I changed the storage to 20 GB. Enable HTTP/HTTPS as well. - Download, and install
gcloud
locally. Select the SSH dropdown for the VM instance you want to connect to. Select thegcloud SSH
option to get the command line to connect via SSH using the gcloud too. https://cloud.google.com/sdk/docs/install. - Follow the steps here to install GitLab: https://about.gitlab.com/install/#ubuntu
- Change the database max connections, and enable the ci connection:
sudo vim /etc/gitlab/gitlab.rb
postgresql['max_connections'] = 8
gitlab_rails['databases']['ci']['enable'] = true
gitlab_rails['databases']['ci']['db_database'] = 'gitlabhq_production'
gitlab_rails['databases']['ci']['database_tasks'] = false
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart
changing max_connections
requires restarting the database This parameter can only be set at server start
Visit the Gitlab instance on http://<PUBLIC_IP_INSTANCE>.nip.io
. Refresh the page a few times and you should get the 500 error
Edited by Omar Qunsul