PERF: Run multiple threads for regular job schedules

Under extreme load on large databases certain regular jobs can take quite
a while to run. We need to ensure we never starve a sidekiq from running
mini scheduler, cause without it we are unable to queue stuff such as
heartbeat jobs.
This commit is contained in:
Sam Saffron
2019-08-29 15:34:36 +10:00
parent 4fce6484fe
commit 098f9e8b5b
3 changed files with 10 additions and 3 deletions

View File

@@ -62,7 +62,7 @@ if Sidekiq.server?
scheduler_hostname = ENV["UNICORN_SCHEDULER_HOSTNAME"]
if !scheduler_hostname || scheduler_hostname.split(',').include?(`hostname`.strip)
MiniScheduler.start
MiniScheduler.start(workers: GlobalSetting.mini_scheduler_workers)
end
end
end