Skip to content

vane-tech/sidekiq-worker-killer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sidekiq-worker-killer

Gem Version CircleCI

Sidekiq is probably the best background processing framework today. At the same time, memory leaks are very hard to tackle in Ruby and we often find ourselves with growing memory consumption.

Highly inspired by Gitlab Sidekiq MemoryKiller and Noxa Sidekiq killer.

Install

Use Bundler

gem "sidekiq-worker-killer"

Usage

Add this to your Sidekiq configuration.

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add Sidekiq::WorkerKiller, max_rss: 480
  end
end

Available options

The following options can be overrided.

Option Defaults Description
max_rss 0 MB (disabled) max RSS in megabytes. Above this, shutdown will be triggered.
grace_time 900 seconds when shutdown is triggered, the Sidekiq process will not accept new job but wait 15 minutes for running jobs to finish.
shutdown_wait 30 seconds when the grace time expires, still running jobs get 30 seconds to terminate. After that, kill signal is triggered.
kill_signal SIGKILL Signal to use kill Sidekiq process if it doesn't terminate.

Authors

See the list of contributors who participated in this project.

License

Please see LICENSE

About

🔪Sidekiq Worker Killer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 98.6%
  • Makefile 1.4%