Skip to content

Allow PostgreSQL adapter tcp parameter tuning

What does this MR do?

Allows administrators to tune the TCP connection parameters in the PostgreSQL adapter for Rails.

Closes: #5634 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened

Closes #5634 (closed)

Testing

  1. Install package and minimal gitlab.rb See dev builds
  2. Run gitlab-ctl reconfigure
  3. Take copy of /opt/gitlab/embedded/service/gitlab-rails/config/database.yml
    cp /opt/gitlab/embedded/service/gitlab-rails/config/database.yml ~/4776_original_database.yml
  4. Add following to /etc/gitlab/gitlab.rb
    # other settings...
    gitlab_rails['db_keepalives'] = 1
    gitlab_rails['db_keepalives_idle'] = 5
    gitlab_rails['db_keepalives_interval'] = 3
    gitlab_rails['db_keepalives_count'] = 3
    gitlab_rails['db_tcp_user_timeout'] = 13000
  5. Run gitlab-ctl reconfigure
  6. Validate diff between copy and new database.yml
    diff /opt/gitlab/embedded/service/gitlab-rails/config/database.yml ~/4776_original_database.yml
  7. Expect diff to look similar to:
    23,27c23,27
    <   keepalives: 1
    <   keepalives_idle: 5
    <   keepalives_interval: 3
    <   keepalives_count: 3
    <   tcp_user_timeout: 13000
    ---
    >   keepalives:
    >   keepalives_idle:
    >   keepalives_interval:
    >   keepalives_count:
    >   tcp_user_timeout:
  8. Clean up
    rm ~/4776_original_database.yml
Edited by DJ Mountney

Merge request reports