diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-28 23:41:00 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-28 23:41:00 +0000 |
commit | e809f6dd9ba3420c0a7bcdaff4d9623c21ed1a55 (patch) | |
tree | cc413a775ecd1ab446f806e222c56a1bf3141414 | |
parent | 3b5ecd35ec79a45aa164ded3ae032a18b8f92324 (diff) | |
parent | 9e783be668d09d6a5688490c74213710ed5f056a (diff) | |
download | gitlab-ce-e809f6dd9ba3420c0a7bcdaff4d9623c21ed1a55.tar.gz |
Merge branch '40396-use-pgroups-for-background-jobs' into 'master'
bin/background_jobs: use pgroups
Closes #40396
See merge request gitlab-org/gitlab-ce!25654
-rwxr-xr-x | bin/background_jobs | 9 | ||||
-rw-r--r-- | changelogs/unreleased/40396-use-pgroups-for-background-jobs.yml | 5 | ||||
-rw-r--r-- | doc/install/installation.md | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/bin/background_jobs b/bin/background_jobs index f28e2f722dc..9d12422b81a 100755 --- a/bin/background_jobs +++ b/bin/background_jobs @@ -38,7 +38,14 @@ start_no_deamonize() start_sidekiq() { - exec bundle exec sidekiq -C "${sidekiq_config}" -e $RAILS_ENV -P $sidekiq_pidfile "$@" + cmd="exec" + chpst=$(which chpst) + + if [ -n "$chpst" ]; then + cmd="${cmd} ${chpst} -P" + fi + + ${cmd} bundle exec sidekiq -C "${sidekiq_config}" -e $RAILS_ENV -P $sidekiq_pidfile "$@" } load_ok() diff --git a/changelogs/unreleased/40396-use-pgroups-for-background-jobs.yml b/changelogs/unreleased/40396-use-pgroups-for-background-jobs.yml new file mode 100644 index 00000000000..578c780e1a1 --- /dev/null +++ b/changelogs/unreleased/40396-use-pgroups-for-background-jobs.yml @@ -0,0 +1,5 @@ +--- +title: 'If chpst is available, make fron-source installations run sidekiq as a process group leader' +merge_request: 25654 +author: +type: other diff --git a/doc/install/installation.md b/doc/install/installation.md index fb24d4fa0ef..61f544deabe 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -9,7 +9,8 @@ On heavily used GitLab instances the memory usage of the Sidekiq background work Omnibus packages solve this by [letting the Sidekiq terminate gracefully](../administration/operations/sidekiq_memory_killer.md) if it uses too much memory. After this termination Runit will detect Sidekiq is not running and will start it. -Since installations from source don't have Runit, Sidekiq can't be terminated and its memory usage will grow over time. +Since installations from source don't use Runit for process supervision, Sidekiq +can't be terminated and its memory usage will grow over time. ## Select Version to Install @@ -72,7 +73,8 @@ Install the required packages (needed to compile Ruby and native extensions to R ```sh sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libre2-dev \ libreadline-dev libncurses5-dev libffi-dev curl openssh-server checkinstall libxml2-dev \ - libxslt-dev libcurl4-openssl-dev libicu-dev logrotate rsync python-docutils pkg-config cmake + libxslt-dev libcurl4-openssl-dev libicu-dev logrotate rsync python-docutils pkg-config cmake \ + runit ``` Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but |