My GitLab Self-Managed instance is experiencing 504 Gateway timeouts and performance degradation. I need to find the primary cause of this issue related to PostgreSQL, the recommended resolution steps including specific commands or configurations, and which GitLab offerings/architectures are impacted, based on the relevant knowledge article.
Navigate to the 'Knowledge Articles' main page. Scroll down to locate the 'Performance' category. Click on the article titled '504 Gateway timeouts and performance degradation after losing Po...'. Read the article to identify the primary cause of the 504 errors and performance degradation. Extract the recommended resolution steps, including any specific commands or configurations. Identify the impacted GitLab offerings or architectures mentioned in the article.
State that the primary cause is a PostgreSQL node going offline and failover handling not kicking in, leading to Rails/Sidekiq nodes timing out when connecting. List the recommended resolution steps, including checking logs (`tail -f /var/log/gitlab/gitlab-rails/database_load_balancing.log`), verifying/updating `gitlab_rails['db_load_balancing_hosts']` in `/etc/gitlab/gitlab.rb`, using `nc -zv HOST PORT` to confirm host accessibility, and performing `gitlab-ctl reconfigure` and `gitlab-ctl restart`. State that the impacted offerings are 'GitLab Self-Managed on 3K reference architecture or higher'.