My GitLab Self-Managed instance is experiencing 504 Gateway timeouts and performance degradation, possibly due to PostgreSQL issues. On support.gitlab.com, find the article addressing this. Explain the root cause, list the detailed resolution steps, and identify which GitLab architectures are typically affected by this problem.
Navigate to 'support.gitlab.com'. Click on 'Knowledge Articles'. Scroll down to locate and click on the 'Performance' category. Click on the article titled '504 Gateway timeouts and performance degradation after losing PostgreSQL nodes'. Identify and extract the primary cause of the issue from the 'Cause' section. Extract all recommended resolution steps, including specific commands and configurations, from the 'Resolution' section. Identify the impacted GitLab offerings or architectures from the 'Environment' section. 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 activating, 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 from `gitlab_rails['db_load_balancing_hosts']`, and performing `gitlab-ctl reconfigure` and `gitlab-ctl restart`. State that the impacted offerings are 'GitLab Self-Managed on 3K reference architecture or higher'.