How to find Sidekiq is running or not How to find Sidekiq is running or not ruby ruby

How to find Sidekiq is running or not


A little trick:

ps aux | grep '[s]idekiq'

Hope it works


Ideally you can do this directly from ruby itself. Put this in some rake task or standalone script (don't forget to specify Sidekiq connection details)

ps = Sidekiq::ProcessSet.newps.size # => 2ps.each do |process|  p process['busy']     # => 3  p process['hostname'] # => 'myhost.local'  p process['pid']      # => 16131endps.each(&:quiet!) # equivalent to the USR1 signalps.each(&:stop!) # equivalent to the TERM signal

From https://github.com/mperham/sidekiq/wiki/API#processes


See this question for how to filter ps output using grep, while eliminating the grep command from the the output.