diff --git a/doc/settings/memory_constrained_envs.md b/doc/settings/memory_constrained_envs.md index 3aa1f00526cfe9314a52ce0d3df7aa986a1478b5_ZG9jL3NldHRpbmdzL21lbW9yeV9jb25zdHJhaW5lZF9lbnZzLm1k..96cc4cb25aac3a3862af25701fdf109afe6d4039_ZG9jL3NldHRpbmdzL21lbW9yeV9jb25zdHJhaW5lZF9lbnZzLm1k 100644 --- a/doc/settings/memory_constrained_envs.md +++ b/doc/settings/memory_constrained_envs.md @@ -145,10 +145,10 @@ ## Optimize Sidekiq Sidekiq is a background processing daemon. When configured with GitLab by default -it runs with a high concurrency mode of `50`. This does impact how much memory it can +it runs with a concurrency mode of `20`. This does impact how much memory it can allocate at a given time. It is advised to configure it to use a significantly smaller value of `5` or `10` (preferred). In `/etc/gitlab/gitlab.rb`: ```ruby @@ -149,10 +149,10 @@ allocate at a given time. It is advised to configure it to use a significantly smaller value of `5` or `10` (preferred). In `/etc/gitlab/gitlab.rb`: ```ruby -sidekiq['max_concurrency'] = 10 +sidekiq['concurrency'] = 10 ``` ## Optimize Gitaly @@ -249,7 +249,7 @@ ```ruby puma['worker_processes'] = 0 - sidekiq['max_concurrency'] = 10 + sidekiq['concurrency'] = 10 prometheus_monitoring['enable'] = false diff --git a/doc/settings/rpi.md b/doc/settings/rpi.md index 3aa1f00526cfe9314a52ce0d3df7aa986a1478b5_ZG9jL3NldHRpbmdzL3JwaS5tZA==..96cc4cb25aac3a3862af25701fdf109afe6d4039_ZG9jL3NldHRpbmdzL3JwaS5tZA== 100644 --- a/doc/settings/rpi.md +++ b/doc/settings/rpi.md @@ -55,7 +55,7 @@ ```ruby # Reduce the number of running workers to the minimum in order to reduce memory usage puma['worker_processes'] = 2 - sidekiq['max_concurrency'] = 9 + sidekiq['concurrency'] = 9 # Turn off monitoring to reduce idle cpu and disk usage prometheus_monitoring['enable'] = false ``` diff --git a/files/gitlab-config-template/gitlab.rb.template b/files/gitlab-config-template/gitlab.rb.template index 3aa1f00526cfe9314a52ce0d3df7aa986a1478b5_ZmlsZXMvZ2l0bGFiLWNvbmZpZy10ZW1wbGF0ZS9naXRsYWIucmIudGVtcGxhdGU=..96cc4cb25aac3a3862af25701fdf109afe6d4039_ZmlsZXMvZ2l0bGFiLWNvbmZpZy10ZW1wbGF0ZS9naXRsYWIucmIudGVtcGxhdGU= 100644 --- a/files/gitlab-config-template/gitlab.rb.template +++ b/files/gitlab-config-template/gitlab.rb.template @@ -1280,9 +1280,7 @@ # sidekiq['log_format'] = "json" # sidekiq['shutdown_timeout'] = 4 # sidekiq['interval'] = nil -# sidekiq['concurrency'] = nil -# sidekiq['max_concurrency'] = 20 -# sidekiq['min_concurrency'] = nil +# sidekiq['concurrency'] = 20 ##! GitLab allows route a job to a particular queue determined by an array of ##! routing rules. ##! Each routing rule is a tuple of queue selector query and corresponding queue. By default, diff --git a/files/gitlab-cookbooks/gitlab/attributes/default.rb b/files/gitlab-cookbooks/gitlab/attributes/default.rb index 3aa1f00526cfe9314a52ce0d3df7aa986a1478b5_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvYXR0cmlidXRlcy9kZWZhdWx0LnJi..96cc4cb25aac3a3862af25701fdf109afe6d4039_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvYXR0cmlidXRlcy9kZWZhdWx0LnJi 100644 --- a/files/gitlab-cookbooks/gitlab/attributes/default.rb +++ b/files/gitlab-cookbooks/gitlab/attributes/default.rb @@ -728,9 +728,7 @@ # Cluster specific settings default['gitlab']['sidekiq']['interval'] = nil -default['gitlab']['sidekiq']['concurrency'] = nil -default['gitlab']['sidekiq']['max_concurrency'] = 20 -default['gitlab']['sidekiq']['min_concurrency'] = nil +default['gitlab']['sidekiq']['concurrency'] = 20 default['gitlab']['sidekiq']['queue_groups'] = ['*'] default['gitlab']['sidekiq']['consul_service_name'] = 'sidekiq' default['gitlab']['sidekiq']['consul_service_meta'] = nil diff --git a/files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb b/files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb index 3aa1f00526cfe9314a52ce0d3df7aa986a1478b5_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvdGVtcGxhdGVzL2RlZmF1bHQvc3Ytc2lkZWtpcS1ydW4uZXJi..96cc4cb25aac3a3862af25701fdf109afe6d4039_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvdGVtcGxhdGVzL2RlZmF1bHQvc3Ytc2lkZWtpcS1ydW4uZXJi 100644 --- a/files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb +++ b/files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb @@ -22,12 +22,6 @@ <% if node['gitlab']['sidekiq']['concurrency'] %> -c <%= node['gitlab']['sidekiq']['concurrency'] %> \ <% end %> - <% if node['gitlab']['sidekiq']['max_concurrency'] %> - -m <%= node['gitlab']['sidekiq']['max_concurrency'] %> \ - <% end %> - <% if node['gitlab']['sidekiq']['min_concurrency'] %> - --min-concurrency <%= node['gitlab']['sidekiq']['min_concurrency'] %> \ - <% end %> <% if node['gitlab']['sidekiq']['shutdown_timeout'] %> --timeout <%= node['gitlab']['sidekiq']['shutdown_timeout'] %> \ <% end %> diff --git a/files/gitlab-cookbooks/package/libraries/deprecations.rb b/files/gitlab-cookbooks/package/libraries/deprecations.rb index 3aa1f00526cfe9314a52ce0d3df7aa986a1478b5_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9kZXByZWNhdGlvbnMucmI=..96cc4cb25aac3a3862af25701fdf109afe6d4039_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9kZXByZWNhdGlvbnMucmI= 100644 --- a/files/gitlab-cookbooks/package/libraries/deprecations.rb +++ b/files/gitlab-cookbooks/package/libraries/deprecations.rb @@ -346,9 +346,9 @@ }, { config_keys: %w(gitlab sidekiq min_concurrency), - deprecation: '16.9', - removal: '17.0', + deprecation: '16.9', # Remove message issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8491 + removal: '17.0', # Removal issue: https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/3422 note: "Starting with GitLab 17.0, `sidekiq['min_concurrency']` will be removed. Please follow https://docs.gitlab.com/ee/administration/sidekiq/extra_sidekiq_processes.html#manage-thread-counts-explicitly to use `sidekiq['concurrency']` instead." }, { config_keys: %w(gitlab sidekiq max_concurrency), @@ -351,9 +351,9 @@ note: "Starting with GitLab 17.0, `sidekiq['min_concurrency']` will be removed. Please follow https://docs.gitlab.com/ee/administration/sidekiq/extra_sidekiq_processes.html#manage-thread-counts-explicitly to use `sidekiq['concurrency']` instead." }, { config_keys: %w(gitlab sidekiq max_concurrency), - deprecation: '16.9', - removal: '17.0', + deprecation: '16.9', # Remove message issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8491 + removal: '17.0', # Removal issue: https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/3422 note: "Starting with GitLab 17.0, `sidekiq['max_concurrency']` will be removed. Please follow https://docs.gitlab.com/ee/administration/sidekiq/extra_sidekiq_processes.html#manage-thread-counts-explicitly to use `sidekiq['concurrency']` instead." }, { diff --git a/spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb b/spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb index 3aa1f00526cfe9314a52ce0d3df7aa986a1478b5_c3BlYy9jaGVmL2Nvb2tib29rcy9naXRsYWIvcmVjaXBlcy9zaWRla2lxX3NwZWMucmI=..96cc4cb25aac3a3862af25701fdf109afe6d4039_c3BlYy9jaGVmL2Nvb2tib29rcy9naXRsYWIvcmVjaXBlcy9zaWRla2lxX3NwZWMucmI= 100644 --- a/spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb +++ b/spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb @@ -26,7 +26,7 @@ expect(content).to match(/rubyopt=\"-W:no-experimental\"/) expect(content).to include(%(RUBYOPT="${rubyopt}")) expect(content).to match(%r{bin/sidekiq-cluster}) - expect(content).to match(/-m 20/) # max_concurrency + expect(content).to match(/-c 20/) # concurrency expect(content).to match(/--timeout 25/) # shutdown timeout expect(content).to match(/\*/) # all queues } @@ -64,8 +64,9 @@ before do stub_gitlab_rb( sidekiq: { - log_group: 'fugee' + log_group: 'fugee', + concurrency: 42 } ) end it_behaves_like 'enabled logged service', 'sidekiq', true, { log_directory_owner: 'git', log_group: 'fugee' } @@ -68,7 +69,14 @@ } ) end it_behaves_like 'enabled logged service', 'sidekiq', true, { log_directory_owner: 'git', log_group: 'fugee' } + + it 'correctly renders out the sidekiq service file' do + expect(chef_run).to render_file("/opt/gitlab/sv/sidekiq/run") + .with_content { |content| + expect(content).to match(/-c 42/) # concurrency + } + end end end