My GitLab Self-Managed instance is showing 504 Gateway timeouts and performance degradation. I suspect it's related to PostgreSQL. Can you find the relevant knowledge article and tell me the root cause, the exact steps to resolve this, and which GitLab architectures are typically affected by this issue?
Navigate to the 'Knowledge Articles' main page on support.gitlab.com. Locate and click on the 'Performance' category. Click on the article titled '504 Gateway timeouts and performance degradation after losing PostgreSQL nodes'. Read the article to identify the primary cause of the 504 errors and performance degradation. Extract all recommended resolution steps, including specific commands and 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 all recommended resolution steps: 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, removing unresponsive IPs, and performing `gitlab-ctl reconfigure` and `gitlab-ctl restart`. State that the impacted offerings are 'GitLab Self-Managed on 3K reference architecture or higher'.