Commit e809f6dd authored by Stan Hu's avatar Stan Hu

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
parents 3b5ecd35 9e783be6
...@@ -38,7 +38,14 @@ start_no_deamonize() ...@@ -38,7 +38,14 @@ start_no_deamonize()
start_sidekiq() 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() load_ok()
......
---
title: 'If chpst is available, make fron-source installations run sidekiq as a process group leader'
merge_request: 25654
author:
type: other
...@@ -9,7 +9,8 @@ On heavily used GitLab instances the memory usage of the Sidekiq background work ...@@ -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. 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. 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 ## Select Version to Install
...@@ -72,7 +73,8 @@ Install the required packages (needed to compile Ruby and native extensions to R ...@@ -72,7 +73,8 @@ Install the required packages (needed to compile Ruby and native extensions to R
```sh ```sh
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libre2-dev \ 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 \ 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 Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment