Skip to content

Commit d94cbec

Browse files
Robert MarshallRyan Egesdahlmarcogregorius
committed
Merge branch 'mg-remove-min-max-concurrency' into 'master'
Remove deprecated min_concurrency and max_concurrency for Sidekiq See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7549 Merged-by: Robert Marshall <rmarshall@gitlab.com> Approved-by: Dustin Collins <714871-dustinmm80@users.noreply.gitlab.com> Approved-by: Robert Marshall <rmarshall@gitlab.com> Reviewed-by: Jason Plum <jplum@gitlab.com> Co-authored-by: Ryan Egesdahl <regesdahl@gitlab.com> Co-authored-by: Gregorius Marco <gmarco@gitlab.com>
2 parents 7a83ad1 + cfa7564 commit d94cbec

File tree

7 files changed

+20
-22
lines changed

7 files changed

+20
-22
lines changed

doc/settings/memory_constrained_envs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ We observed 100-400MB of memory usage reduction configuring Puma this way.
145145
## Optimize Sidekiq
146146

147147
Sidekiq is a background processing daemon. When configured with GitLab by default
148-
it runs with a high concurrency mode of `50`. This does impact how much memory it can
148+
it runs with a concurrency mode of `20`. This does impact how much memory it can
149149
allocate at a given time. It is advised to configure it to use a significantly
150150
smaller value of `5` or `10` (preferred).
151151

152152
In `/etc/gitlab/gitlab.rb`:
153153

154154
```ruby
155-
sidekiq['max_concurrency'] = 10
155+
sidekiq['concurrency'] = 10
156156
```
157157

158158
## Optimize Gitaly
@@ -249,7 +249,7 @@ and disable the Prometheus Metrics feature:
249249
```ruby
250250
puma['worker_processes'] = 0
251251

252-
sidekiq['max_concurrency'] = 10
252+
sidekiq['concurrency'] = 10
253253

254254
prometheus_monitoring['enable'] = false
255255

doc/settings/rpi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ some running processes:
5555
```ruby
5656
# Reduce the number of running workers to the minimum in order to reduce memory usage
5757
puma['worker_processes'] = 2
58-
sidekiq['max_concurrency'] = 9
58+
sidekiq['concurrency'] = 9
5959
# Turn off monitoring to reduce idle cpu and disk usage
6060
prometheus_monitoring['enable'] = false
6161
```

files/gitlab-config-template/gitlab.rb.template

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,7 @@ external_url 'GENERATED_EXTERNAL_URL'
12801280
# sidekiq['log_format'] = "json"
12811281
# sidekiq['shutdown_timeout'] = 4
12821282
# sidekiq['interval'] = nil
1283-
# sidekiq['concurrency'] = nil
1284-
# sidekiq['max_concurrency'] = 20
1285-
# sidekiq['min_concurrency'] = nil
1283+
# sidekiq['concurrency'] = 20
12861284

12871285
##! GitLab allows route a job to a particular queue determined by an array of ##! routing rules.
12881286
##! Each routing rule is a tuple of queue selector query and corresponding queue. By default,

files/gitlab-cookbooks/gitlab/attributes/default.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,7 @@
728728

729729
# Cluster specific settings
730730
default['gitlab']['sidekiq']['interval'] = nil
731-
default['gitlab']['sidekiq']['concurrency'] = nil
732-
default['gitlab']['sidekiq']['max_concurrency'] = 20
733-
default['gitlab']['sidekiq']['min_concurrency'] = nil
731+
default['gitlab']['sidekiq']['concurrency'] = 20
734732
default['gitlab']['sidekiq']['queue_groups'] = ['*']
735733
default['gitlab']['sidekiq']['consul_service_name'] = 'sidekiq'
736734
default['gitlab']['sidekiq']['consul_service_meta'] = nil

files/gitlab-cookbooks/gitlab/templates/default/sv-sidekiq-run.erb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ exec chpst -e /opt/gitlab/etc/gitlab-rails/env -P \
2222
<% if node['gitlab']['sidekiq']['concurrency'] %>
2323
-c <%= node['gitlab']['sidekiq']['concurrency'] %> \
2424
<% end %>
25-
<% if node['gitlab']['sidekiq']['max_concurrency'] %>
26-
-m <%= node['gitlab']['sidekiq']['max_concurrency'] %> \
27-
<% end %>
28-
<% if node['gitlab']['sidekiq']['min_concurrency'] %>
29-
--min-concurrency <%= node['gitlab']['sidekiq']['min_concurrency'] %> \
30-
<% end %>
3125
<% if node['gitlab']['sidekiq']['shutdown_timeout'] %>
3226
--timeout <%= node['gitlab']['sidekiq']['shutdown_timeout'] %> \
3327
<% end %>

files/gitlab-cookbooks/package/libraries/deprecations.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ def list(existing_config = nil)
346346
},
347347
{
348348
config_keys: %w(gitlab sidekiq min_concurrency),
349-
deprecation: '16.9',
350-
removal: '17.0',
349+
deprecation: '16.9', # Remove message issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8491
350+
removal: '17.0', # Removal issue: https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/3422
351351
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."
352352
},
353353
{
354354
config_keys: %w(gitlab sidekiq max_concurrency),
355-
deprecation: '16.9',
356-
removal: '17.0',
355+
deprecation: '16.9', # Remove message issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8491
356+
removal: '17.0', # Removal issue: https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/3422
357357
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."
358358
},
359359
{

spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
expect(content).to match(/rubyopt=\"-W:no-experimental\"/)
2727
expect(content).to include(%(RUBYOPT="${rubyopt}"))
2828
expect(content).to match(%r{bin/sidekiq-cluster})
29-
expect(content).to match(/-m 20/) # max_concurrency
29+
expect(content).to match(/-c 20/) # concurrency
3030
expect(content).to match(/--timeout 25/) # shutdown timeout
3131
expect(content).to match(/\*/) # all queues
3232
}
@@ -64,11 +64,19 @@
6464
before do
6565
stub_gitlab_rb(
6666
sidekiq: {
67-
log_group: 'fugee'
67+
log_group: 'fugee',
68+
concurrency: 42
6869
}
6970
)
7071
end
7172
it_behaves_like 'enabled logged service', 'sidekiq', true, { log_directory_owner: 'git', log_group: 'fugee' }
73+
74+
it 'correctly renders out the sidekiq service file' do
75+
expect(chef_run).to render_file("/opt/gitlab/sv/sidekiq/run")
76+
.with_content { |content|
77+
expect(content).to match(/-c 42/) # concurrency
78+
}
79+
end
7280
end
7381
end
7482

0 commit comments

Comments
 (0)