diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /lib/gitlab/runtime.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'lib/gitlab/runtime.rb')
-rw-r--r-- | lib/gitlab/runtime.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/gitlab/runtime.rb b/lib/gitlab/runtime.rb index bf579dd3b77..abf6ee07d53 100644 --- a/lib/gitlab/runtime.rb +++ b/lib/gitlab/runtime.rb @@ -37,7 +37,7 @@ module Gitlab end def puma? - !!defined?(::Puma) + !!defined?(::Puma) && !defined?(ACTION_CABLE_SERVER) end # For unicorn, we need to check for actual server instances to avoid false positives. @@ -70,25 +70,31 @@ module Gitlab end def web_server? - puma? || unicorn? + puma? || unicorn? || action_cable? + end + + def action_cable? + !!defined?(ACTION_CABLE_SERVER) end def multi_threaded? - puma? || sidekiq? + puma? || sidekiq? || action_cable? end def max_threads main_thread = 1 - if puma? - Puma.cli_config.options[:max_threads] + main_thread + if action_cable? + Gitlab::Application.config.action_cable.worker_pool_size + elsif puma? + Puma.cli_config.options[:max_threads] elsif sidekiq? # An extra thread for the poller in Sidekiq Cron: # https://github.com/ondrejbartas/sidekiq-cron#under-the-hood - Sidekiq.options[:concurrency] + main_thread + 1 + Sidekiq.options[:concurrency] + 1 else - main_thread - end + 0 + end + main_thread end end end |