9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/unicorn/worker-killer-2/oom.rb', line 9
def process_client(client)
super(client)
return if @_worker_memory_limit_min.zero? &&
@_worker_memory_limit_max.zero?
@_worker_check_count ||= 0
@_worker_check_count += 1
return unless (@_worker_check_count % @_worker_check_cycle).zero?
= GetProcessMem.new.bytes
logger.info "#{self}: worker (pid: #{Process.pid}) using #{} bytes." if @_verbose
return if < @_worker_memory_limit
logger.warn "#{self}: worker (pid: #{Process.pid}) exceeds memory limit (#{} bytes > #{@_worker_memory_limit} bytes)"
WorkerKiller.kill_self(logger, @_worker_process_start)
end
|