From df460b4abd6156567edb46ea8a673ddec44be3e5 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 9 Jan 2019 09:29:14 +1100 Subject: [PATCH] PERF: run sidekiq with nice 5 This ensures that unicorn master forks of sidekiq run with a lower priority than the webs. It means that a busy sidekiq is less likely to impact web performance --- lib/demon/sidekiq.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/demon/sidekiq.rb b/lib/demon/sidekiq.rb index 0ca7ba9994a..bfb25f2bf5e 100644 --- a/lib/demon/sidekiq.rb +++ b/lib/demon/sidekiq.rb @@ -43,6 +43,10 @@ class Demon::Sidekiq < Demon::Base end end + # Sidekiq not as high priority as web, in this environment it is forked so a web is very + # likely running + Discourse::Utils.execute_command('renice', '-n', '5', '-p', Process.pid.to_s) + cli.parse(options) load Rails.root + "config/initializers/100-sidekiq.rb" cli.run