My GitLab Self-Managed instance is experiencing 504 Gateway timeouts and performance degradation, which I suspect is related to PostgreSQL. Research a solution on support.gitlab.com. Explain the root cause of this issue, list the exact steps to resolve it, and identify which GitLab architectures are typically affected.
Navigate to 'support.gitlab.com'. Browse the 'Knowledge Articles' to find the 'Performance' category. Click on the 'Performance' category. Locate and 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, from the article. Identify the impacted GitLab offerings or architectures mentioned in the article. Synthesize the root cause, resolution steps, and impacted architectures into a concise answer.
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, 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, 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'.