mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Merge pull request #1716 from mdkent/min-worker_timeout
Min worker timeout
This commit is contained in:
commit
0b15d4ff6c
2 changed files with 9 additions and 1 deletions
|
@ -176,7 +176,8 @@
|
|||
# the given timeout. If not the worker process will be restarted. This is
|
||||
# not a request timeout, it is to protect against a hung or dead process.
|
||||
# Setting this value will not protect against slow requests.
|
||||
# Default value is 60 seconds.
|
||||
#
|
||||
# The minimum value is 6 seconds, the default value is 60 seconds.
|
||||
#
|
||||
# worker_timeout 60
|
||||
|
||||
|
|
|
@ -451,6 +451,13 @@ module Puma
|
|||
# that have not checked in within the given +timeout+.
|
||||
# This mitigates hung processes. Default value is 60 seconds.
|
||||
def worker_timeout(timeout)
|
||||
timeout = Integer(timeout)
|
||||
min = Cluster::WORKER_CHECK_INTERVAL
|
||||
|
||||
if timeout <= min
|
||||
raise "The minimum worker_timeout must be greater than the worker reporting interval (#{min})"
|
||||
end
|
||||
|
||||
@options[:worker_timeout] = Integer(timeout)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue