Sha256: 713b0f4b76e99dc8e2c0d117bea5bd2e5b46ed51179ce2600895fa544ae12a32

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

require_relative 'dead_children'
require_relative '../memory'
module Sidekiq
  module Cluster
    module Monitors
      class OOM < Base
        def monitor
          pool.info 'watching for worker processes exceeding size threshold'
          loop do
            sleep SLEEP_DELAY + 1
            ::Sidekiq::Cluster::Memory.offenders(pool).each { |worker| worker.respawn! }
            break unless pool.operational?
            log_periodically "monitor for Out Of Memory is operational, last logged at #{@last_logged_at}" do
              pool.workers.map(&:status)
            end
          end
          pool.info 'leaving Memory Monitor.'
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sidekiq-cluster-0.1.2 lib/sidekiq/cluster/monitors/oom.rb