Commit 5dc6321c authored by Kirill Smelkov's avatar Kirill Smelkov

gitlab/unicorn: Automatically load all available CPUs by default

Automatically configure unicorn to spawn as much worker processes as
there are CPUs on the system by default.

GitLab omnibus pre-hardcodes this value default to 2 (which we copied)
and then also tweaks it this way in active code

    https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8eda0933/files/gitlab-cookbooks/gitlab/attributes/default.rb#L230

which we also do here.

/cc @kazuhiko, @jerome
parent b55d823d
...@@ -45,6 +45,11 @@ cert = ${slap-connection:cert-file} ...@@ -45,6 +45,11 @@ cert = ${slap-connection:cert-file}
# autogenerated gitlab instance parameters # autogenerated gitlab instance parameters
<= gitlab-parameters <= gitlab-parameters
# adjust/override some default settings:
# automatically load all available CPUs
configuration.unicorn_worker_processes = {{ multiprocessing.cpu_count() + 1 }}
# for convenience # for convenience
......
...@@ -22,6 +22,7 @@ rendered= $${buildout:directory}/instance-gitlab.cfg ...@@ -22,6 +22,7 @@ rendered= $${buildout:directory}/instance-gitlab.cfg
context = context =
import os os import os os
import pwd pwd import pwd pwd
import multiprocessing multiprocessing
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
......
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