resque-pool 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +17 -0
- data/.github/release.yml +28 -0
- data/.github/workflows/codeql-analysis.yml +74 -0
- data/.github/workflows/push_gem.yml +50 -0
- data/.github/workflows/ruby.yml +61 -0
- data/.gitignore +4 -0
- data/.travis.yml +4 -4
- data/Appraisals +41 -0
- data/Changelog.md +112 -11
- data/Gemfile +2 -0
- data/README.md +12 -6
- data/gemfiles/resque_2.2_redis_4.6.gemfile +10 -0
- data/gemfiles/resque_2.3_redis_4.7.gemfile +10 -0
- data/gemfiles/resque_2.4_redis_4.8.gemfile +10 -0
- data/gemfiles/resque_2.5_redis_5.0.gemfile +10 -0
- data/gemfiles/resque_2.6_redis_5.2.gemfile +10 -0
- data/gemfiles/resque_2.7_redis_5.4.gemfile +10 -0
- data/gemfiles/resque_3.0_redis_5.4.gemfile +10 -0
- data/lib/resque/pool/cli.rb +28 -12
- data/lib/resque/pool/logging.rb +4 -19
- data/lib/resque/pool/version.rb +1 -1
- data/lib/resque/pool.rb +29 -4
- data/man/resque-pool.1 +81 -69
- data/man/resque-pool.1.ronn +66 -21
- data/man/resque-pool.yml.5 +4 -19
- data/man/resque-pool.yml.5.ronn +3 -2
- data/resque-pool.gemspec +13 -12
- metadata +44 -42
- data/Gemfile.lock +0 -102
- data/examples/Gemfile.lock +0 -80
data/lib/resque/pool/cli.rb
CHANGED
|
@@ -32,11 +32,22 @@ module Resque
|
|
|
32
32
|
|
|
33
33
|
Usage:
|
|
34
34
|
resque-pool [options]
|
|
35
|
-
|
|
36
|
-
where [options] are:
|
|
37
35
|
EOS
|
|
36
|
+
|
|
37
|
+
opt.separator ""
|
|
38
|
+
opt.separator "Basic Options:"
|
|
38
39
|
opt.on('-c', '--config PATH', "Alternate path to config file") { |c| opts[:config] = c }
|
|
39
|
-
opt.on('-a', '--appname NAME', "Alternate appname") { |c| opts[:appname] = c }
|
|
40
|
+
opt.on('-a', '--appname NAME', "Alternate appname (default is directory name)") { |c| opts[:appname] = c }
|
|
41
|
+
opt.on("-E", '--environment ENVIRONMENT', "Set RAILS_ENV/RACK_ENV/RESQUE_ENV") { |c| opts[:environment] = c }
|
|
42
|
+
|
|
43
|
+
opt.separator ""
|
|
44
|
+
opt.separator "Logging options:"
|
|
45
|
+
opt.on('-o', '--stdout FILE', "Redirect stdout to logfile") { |c| opts[:stdout] = c }
|
|
46
|
+
opt.on('-e', '--stderr FILE', "Redirect stderr to logfile") { |c| opts[:stderr] = c }
|
|
47
|
+
opt.on('--nosync', "Don't sync logfiles on every write") { opts[:nosync] = true }
|
|
48
|
+
|
|
49
|
+
opt.separator ""
|
|
50
|
+
opt.separator "Daemon options:"
|
|
40
51
|
opt.on("-d", '--daemon', "Run as a background daemon") {
|
|
41
52
|
opts[:daemon] = true
|
|
42
53
|
opts[:stdout] ||= "log/resque-pool.stdout.log"
|
|
@@ -44,9 +55,6 @@ module Resque
|
|
|
44
55
|
opts[:pidfile] ||= "tmp/pids/resque-pool.pid" unless opts[:no_pidfile]
|
|
45
56
|
}
|
|
46
57
|
opt.on("-k", '--kill-others', "Shutdown any other Resque Pools on startup") { opts[:killothers] = true }
|
|
47
|
-
opt.on('-o', '--stdout FILE', "Redirect stdout to logfile") { |c| opts[:stdout] = c }
|
|
48
|
-
opt.on('-e', '--stderr FILE', "Redirect stderr to logfile") { |c| opts[:stderr] = c }
|
|
49
|
-
opt.on('--nosync', "Don't sync logfiles on every write") { opts[:nosync] = true }
|
|
50
58
|
opt.on("-p", '--pidfile FILE', "PID file location") { |c|
|
|
51
59
|
opts[:pidfile] = c
|
|
52
60
|
opts[:no_pidfile] = false
|
|
@@ -55,20 +63,28 @@ module Resque
|
|
|
55
63
|
opts[:pidfile] = nil
|
|
56
64
|
opts[:no_pidfile] = true
|
|
57
65
|
}
|
|
58
|
-
opt.on('-l', '--lock FILE' "Open a shared lock on a file") {
|
|
66
|
+
opt.on('-l', '--lock FILE', "Open a shared lock on a file") {|c| opts[:lock_file] = c }
|
|
59
67
|
opt.on("-H", "--hot-swap", "Set appropriate defaults to hot-swap a new pool for a running pool") {|c|
|
|
60
68
|
opts[:pidfile] = nil
|
|
61
69
|
opts[:no_pidfile] = true
|
|
62
70
|
opts[:lock_file] ||= "tmp/resque-pool.lock"
|
|
63
71
|
opts[:killothers] = true
|
|
64
72
|
}
|
|
65
|
-
opt.on(
|
|
66
|
-
|
|
73
|
+
opt.on('--single-process-group', "Workers remain in the same process group as the master") { opts[:single_process_group] = true }
|
|
74
|
+
|
|
75
|
+
opt.separator ""
|
|
76
|
+
opt.separator "Signal handling options:"
|
|
67
77
|
opt.on('--term-graceful-wait', "On TERM signal, wait for workers to shut down gracefully") { opts[:term_graceful_wait] = true }
|
|
68
78
|
opt.on('--term-graceful', "On TERM signal, shut down workers gracefully") { opts[:term_graceful] = true }
|
|
69
79
|
opt.on('--term-immediate', "On TERM signal, shut down workers immediately (default)") { opts[:term_immediate] = true }
|
|
70
|
-
|
|
71
|
-
opt.
|
|
80
|
+
|
|
81
|
+
opt.separator ""
|
|
82
|
+
opt.separator "Worker options:"
|
|
83
|
+
opt.on("-s", '--spawn-delay MS', Integer, "Delay in milliseconds between spawning missing workers") { |c| opts[:spawn_delay] = c }
|
|
84
|
+
|
|
85
|
+
opt.separator ""
|
|
86
|
+
opt.separator "Other options:"
|
|
87
|
+
opt.on("-h", "--help", "Show this help text.") { puts opt; exit }
|
|
72
88
|
opt.on("-v", "--version", "Show Version"){ puts "resque-pool #{VERSION} (c) nicholas a. evans"; exit}
|
|
73
89
|
end
|
|
74
90
|
parser.parse!(argv || parser.default_argv)
|
|
@@ -150,7 +166,7 @@ module Resque
|
|
|
150
166
|
elsif opts[:term_graceful]
|
|
151
167
|
Resque::Pool.term_behavior = "graceful_worker_shutdown"
|
|
152
168
|
elsif ENV["TERM_CHILD"]
|
|
153
|
-
log "TERM_CHILD enabled, so will
|
|
169
|
+
log "TERM_CHILD enabled, so will use 'term-graceful-and-wait' behaviour"
|
|
154
170
|
Resque::Pool.term_behavior = "graceful_worker_shutdown_and_wait"
|
|
155
171
|
end
|
|
156
172
|
if ENV.include?("DYNO") && !ENV["TERM_CHILD"]
|
data/lib/resque/pool/logging.rb
CHANGED
|
@@ -36,25 +36,10 @@ module Resque
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
begin
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
# Fwiw, GVL has zero bearing here. This is tricky because of
|
|
44
|
-
# the unavoidable existence of stdio FILE * pointers for
|
|
45
|
-
# std{in,out,err} in all programs which may use the standard C library
|
|
46
|
-
if fp.fileno <= 2
|
|
47
|
-
# We do not want to hit fclose(3)->dup(2) window for std{in,out,err}
|
|
48
|
-
# MRI will use freopen(3) here internally on std{in,out,err}
|
|
49
|
-
fp.reopen(fp.path, "a")
|
|
50
|
-
else
|
|
51
|
-
# We should not need this workaround, Ruby can be fixed:
|
|
52
|
-
# http://bugs.ruby-lang.org/issues/9036
|
|
53
|
-
# MRI will not call call fclose(3) or freopen(3) here
|
|
54
|
-
# since there's no associated std{in,out,err} FILE * pointer
|
|
55
|
-
# This should atomically use dup3(2) (or dup2(2)) syscall
|
|
56
|
-
File.open(fp.path, "a") { |tmpfp| fp.reopen(tmpfp) }
|
|
57
|
-
end
|
|
39
|
+
fp.reopen(fp.path,
|
|
40
|
+
mode: "a",
|
|
41
|
+
external_encoding: fp.external_encoding,
|
|
42
|
+
internal_encoding: fp.internal_encoding)
|
|
58
43
|
|
|
59
44
|
fp.sync = true
|
|
60
45
|
fp.flush # IO#sync=true may not implicitly flush
|
data/lib/resque/pool/version.rb
CHANGED
data/lib/resque/pool.rb
CHANGED
|
@@ -13,7 +13,7 @@ module Resque
|
|
|
13
13
|
class Pool
|
|
14
14
|
SIG_QUEUE_MAX_SIZE = 5
|
|
15
15
|
DEFAULT_WORKER_INTERVAL = 5
|
|
16
|
-
QUEUE_SIGS = [ :QUIT, :INT, :TERM, :USR1, :USR2, :CONT, :HUP, :WINCH, ]
|
|
16
|
+
QUEUE_SIGS = [ :QUIT, :INT, :TERM, :USR1, :USR2, :CONT, :HUP, :WINCH, Signal.signame(29).to_sym ]
|
|
17
17
|
CHUNK_SIZE = (16 * 1024)
|
|
18
18
|
|
|
19
19
|
include Logging
|
|
@@ -63,8 +63,8 @@ module Resque
|
|
|
63
63
|
|
|
64
64
|
##
|
|
65
65
|
# :call-seq:
|
|
66
|
-
#
|
|
67
|
-
#
|
|
66
|
+
# after_spawn do |worker, pid, workers| ... end => add a hook
|
|
67
|
+
# after_spawn << hook => add a hook
|
|
68
68
|
#
|
|
69
69
|
# The `after_spawn` hooks will run in the master after spawning a new
|
|
70
70
|
# worker.
|
|
@@ -72,6 +72,18 @@ module Resque
|
|
|
72
72
|
# :yields: worker, pid, workers
|
|
73
73
|
hook :after_spawn
|
|
74
74
|
|
|
75
|
+
##
|
|
76
|
+
# :call-seq:
|
|
77
|
+
# siginfo do |pool_instance, pid, workers| ... end => add a hook
|
|
78
|
+
# siginfo << hook => add a hook
|
|
79
|
+
#
|
|
80
|
+
# The `siginfo` hooks will run in the master after receiving a SIGINFO 29 signal.
|
|
81
|
+
# A given block will receive the instance of the running manager pool,
|
|
82
|
+
# the manager pid and the workers hash.
|
|
83
|
+
#
|
|
84
|
+
# :yields: pid, workers
|
|
85
|
+
hook :siginfo
|
|
86
|
+
|
|
75
87
|
# }}}
|
|
76
88
|
# Config: class methods to start up the pool using the config loader {{{
|
|
77
89
|
|
|
@@ -235,6 +247,11 @@ module Resque
|
|
|
235
247
|
else
|
|
236
248
|
shutdown_everything_now!(signal)
|
|
237
249
|
end
|
|
250
|
+
when Signal.signame(29).to_sym
|
|
251
|
+
maintain_worker_count
|
|
252
|
+
Thread.start(self, Process.pid, workers) do |instance, pid, workers|
|
|
253
|
+
call_siginfo!(instance, pid, workers)
|
|
254
|
+
end.join
|
|
238
255
|
end
|
|
239
256
|
end
|
|
240
257
|
|
|
@@ -415,7 +432,15 @@ module Resque
|
|
|
415
432
|
call_after_prefork!(worker)
|
|
416
433
|
reset_sig_handlers!
|
|
417
434
|
#self_pipe.each {|io| io.close }
|
|
418
|
-
|
|
435
|
+
# will block until a shutdown signal is received
|
|
436
|
+
if worker.method(:work).parameters.size > 2 # Backwards compat
|
|
437
|
+
worker.work(ENV["INTERVAL"],
|
|
438
|
+
max_interval: ENV['MAX_INTERVAL'],
|
|
439
|
+
min_interval: ENV['MIN_INTERVAL'],
|
|
440
|
+
backoff_interval: ENV['BACKOFF_INTERVAL'])
|
|
441
|
+
else
|
|
442
|
+
worker.work(ENV['INTERVAL'] || DEFAULT_WORKER_INTERVAL)
|
|
443
|
+
end
|
|
419
444
|
end
|
|
420
445
|
workers[queues][pid] = worker
|
|
421
446
|
call_after_spawn!(worker, pid, workers)
|
data/man/resque-pool.1
CHANGED
|
@@ -1,88 +1,100 @@
|
|
|
1
|
-
.\" generated with Ronn/v0.
|
|
2
|
-
.\" http://github.com/
|
|
3
|
-
.
|
|
4
|
-
.TH "RESQUE\-POOL" "1" "June 2012" "RESQUE-POOL 0.4.0.DEV" "RESQUE-POOL"
|
|
5
|
-
.
|
|
1
|
+
.\" generated with Ronn-NG/v0.10.1
|
|
2
|
+
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
|
3
|
+
.TH "RESQUE\-POOL" "1" "February 2026" "RESQUE-POOL 0.7.1" "RESQUE-POOL"
|
|
6
4
|
.SH "NAME"
|
|
7
5
|
\fBresque\-pool\fR \- resque worker pool management
|
|
8
|
-
.
|
|
9
6
|
.SH "SYNOPSIS"
|
|
10
|
-
\fBresque\-pool\fR
|
|
11
|
-
.
|
|
7
|
+
\fBresque\-pool\fR [
|
|
12
8
|
.SH "DESCRIPTION"
|
|
13
9
|
\fBResque\-pool\fR is the best way to manage a group (pool) of resque workers\.
|
|
14
|
-
.
|
|
15
10
|
.P
|
|
16
11
|
When resque\-pool(1) is daemonized the \fBstdout\fR and \fBstderr\fR output streams are redirected to \fBresque\-pool\.stdxxx\.log\fR log files in the \fBlog\fR directory\. Additionally the PID file defaults to \fBresque\-pool\.pid\fR in the \fBtmp/pids\fR directory\.
|
|
17
|
-
.
|
|
18
12
|
.SH "OPTIONS"
|
|
19
|
-
.
|
|
20
|
-
.
|
|
21
|
-
\fB\-c, \-\-config\fR \fIfile\fR
|
|
22
|
-
|
|
23
|
-
.
|
|
24
|
-
\fB\-a, \-\-appname\fR \fIname\fR
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
\fB\-
|
|
28
|
-
|
|
13
|
+
.SS "Basic options"
|
|
14
|
+
.TP
|
|
15
|
+
\fB\-c, \-\-config\fR \fIfile\fR
|
|
16
|
+
Uses the configuration specified in the \fIfile\fR provided instead of searching in the current and \fBconfig\fR directories for \fBresque\-pool\.yml\fR\.
|
|
17
|
+
.TP
|
|
18
|
+
\fB\-a, \-\-appname\fR \fIname\fR
|
|
19
|
+
Specifies the app name to be used for logging and procline\. If not specified, this defaults to the name of the current working directory\.
|
|
20
|
+
.TP
|
|
21
|
+
\fB\-E, \-\-environment\fR \fIname\fR
|
|
22
|
+
Specifies the environment \fIname\fR to be set for \fBRAILS_ENV\fR, \fBRACK_ENV\fR and \fBRESQUE_ENV\fR which will be passed on to the pooled resque workers\.
|
|
23
|
+
.SS "Logging options"
|
|
29
24
|
.IP "\(bu" 4
|
|
30
25
|
\fB\-o, \-\-stdout\fR \fIfile\fR: Writes the normal log output to \fIfile\fR instead of printing to the terminal\. When running as a daemon this defaults to the path \fBlog/resque\-pool\.stdout\.log\fR\.
|
|
31
|
-
.
|
|
32
26
|
.IP "\(bu" 4
|
|
33
27
|
\fB\-e, \-\-stderr\fR \fIfile\fR: Writes the standard error output to \fIfile\fR instead of printing to the terminal\. When running as a daemon this defaults to the path \fBlog/resque\-pool\.stderr\.log\fR\.
|
|
34
|
-
.
|
|
35
28
|
.IP "\(bu" 4
|
|
36
29
|
\fB\-\-nosync\fR Allows writes to \fBstdout\fR and \fBstderr\fR to be buffered\.
|
|
37
|
-
.
|
|
38
|
-
.IP "\(bu" 4
|
|
39
|
-
\fB\-p, \-\-pidfile\fR \fIfile\fR: Writes the PID to the \fIfile\fR\. When running as a daemon this defaults to \fBtmp/pids/resque\-pool\.pid\fR\.
|
|
40
|
-
.
|
|
41
|
-
.IP "\(bu" 4
|
|
42
|
-
\fB\-E, \-\-environment\fR \fIname\fR: Specifies the environment \fIname\fR to be set for \fBRAILS_ENV\fR, \fBRACK_ENV\fR and \fBRESQUE_ENV\fR which will be passed on to the pooled resque workers\.
|
|
43
|
-
.
|
|
44
|
-
.IP "\(bu" 4
|
|
45
|
-
\fB\-\-term\-graceful\-wait\fR: Configure TERM signal handling so the master will gracefully request worker shut downs (via \fBQUIT\fR) and wait for the workers to quit before shutting down itself\. This is the same behavior as the \fBQUIT\fR signal\.
|
|
46
|
-
.
|
|
47
|
-
.IP "\(bu" 4
|
|
48
|
-
\fB\-\-term\-graceful\fR: Configure TERM signal handling so the master will gracefully request worker shut downs (via \fBQUIT\fR) but shut itself down immediately\. This the same behavior as the \fBINT\fR signal\.
|
|
49
|
-
.
|
|
50
|
-
.IP "\(bu" 4
|
|
51
|
-
\fB\-\-term\-immediate\fR: Configure TERM signal handling so the master will request imediate worker shut downs (via \fBINT\fR) and shut itself down immediately\. This is the default \fBTERM\fR signal behavior\.
|
|
52
|
-
.
|
|
53
30
|
.IP "" 0
|
|
54
|
-
.
|
|
55
|
-
.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
.TP
|
|
68
|
-
\
|
|
69
|
-
|
|
70
|
-
.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.
|
|
77
|
-
.TP
|
|
78
|
-
\
|
|
79
|
-
\
|
|
80
|
-
.
|
|
31
|
+
.SS "Daemon options"
|
|
32
|
+
.TP
|
|
33
|
+
\fB\-d, \-\-daemon\fR
|
|
34
|
+
Runs \fBresque\-pool\fR in the background as a daemon process\. This will redirect \fBstdout\fR and \fBstderr\fR to log files and write a PID file\.
|
|
35
|
+
.TP
|
|
36
|
+
\fB\-k, \-\-kill\-others\fR
|
|
37
|
+
Shutdown any other Resque Pools on startup\.
|
|
38
|
+
.TP
|
|
39
|
+
\fB\-p, \-\-pidfile\fR \fIfile\fR
|
|
40
|
+
Writes the PID to the \fIfile\fR\. When running as a daemon this defaults to \fBtmp/pids/resque\-pool\.pid\fR\.
|
|
41
|
+
.TP
|
|
42
|
+
\fB\-\-no\-pidfile\fR \fIfile\fR
|
|
43
|
+
Do not use a PID file, even when daemonized\.
|
|
44
|
+
.TP
|
|
45
|
+
\fB\-l, \-\-lock\fR \fIfile\fR
|
|
46
|
+
Obtain a lock on a file that will be held for the lifetime of the process\. This aids in concurrent daemonized deployment with some process managers since multiple pools can share a lock, but not a pidfile\.
|
|
47
|
+
.TP
|
|
48
|
+
\fB\-H, \-\-hot\-swap\fR
|
|
49
|
+
Set appropriate defaults to hot\-swap a new pool for a running pool\. This is an alias for \fB\-\-no\-pidfile \-\-lock tmp/resque\-pool\.lock \-\-kill\-others\fR\.
|
|
50
|
+
.TP
|
|
51
|
+
\fB\-\-single\-process\-group\fR
|
|
52
|
+
Workers remain in the same process group as the master\.
|
|
53
|
+
.SS "Signal handling options"
|
|
54
|
+
.TP
|
|
55
|
+
\fB\-\-term\-graceful\-wait\fR
|
|
56
|
+
Configure TERM signal handling so the master will gracefully request worker shut downs (via \fBQUIT\fR) and wait for the workers to quit before shutting down itself\. This is the same behavior as the \fBQUIT\fR signal\.
|
|
57
|
+
.TP
|
|
58
|
+
\fB\-\-term\-graceful\fR
|
|
59
|
+
Configure TERM signal handling so the master will gracefully request worker shut downs (via \fBQUIT\fR) but shut itself down immediately\. This the same behavior as the \fBINT\fR signal\.
|
|
60
|
+
.TP
|
|
61
|
+
\fB\-\-term\-immediate\fR
|
|
62
|
+
Configure TERM signal handling so the master will request imediate worker shut downs (via \fBINT\fR) and shut itself down immediately\. This is the default \fBTERM\fR signal behavior\.
|
|
63
|
+
.SS "Worker options"
|
|
64
|
+
.TP
|
|
65
|
+
\fB\-s, \-\-spawn\-delay\fR \fImilliseconds\fR
|
|
66
|
+
Delay in milliseconds between spawning missing workers\.
|
|
67
|
+
.SH "ENVIRONMENT"
|
|
68
|
+
Environment variables may be used for some configuration\.
|
|
69
|
+
.TP
|
|
70
|
+
\fBRESQUE_POOL_CONFIG\fR
|
|
71
|
+
Sets the config file file\. Overridden by \fB\-\-config\fR\.
|
|
72
|
+
.TP
|
|
73
|
+
\fBRESQUE_SINGLE_PGRP\fR
|
|
74
|
+
Enables \fB\-\-single\-process\-group\fR behavior\.
|
|
75
|
+
.TP
|
|
76
|
+
\fBTERM_CHILD\fR
|
|
77
|
+
Enables \fB\-\-term\-graceful\-wait\fR behavior and uses \fBTERM\fR to stop workers\. Resque workers inherit \fBTERM_CHILD\fR so \fBresque\-pool\fR will use \fBTERM\fR to stop them\.
|
|
78
|
+
.P
|
|
79
|
+
The following environment variables are not \fIdirectly\fR used by \fBresque\-pool\fR, but are used to explicitly configure \fBresque\fR worker processes\. See the \fBresque\fR documentation for detailed description\.
|
|
80
|
+
.TP
|
|
81
|
+
\fBINTERVAL\fR, \fBMAX_INTERVAL\fR, \fBMIN_INTERVAL\fR, \fBBACKOFF_INTERVAL\fR
|
|
82
|
+
The job polling interval for idle workers, in seconds\.
|
|
83
|
+
.TP
|
|
84
|
+
\fBRESQUE_TERM_TIMEOUT\fR
|
|
85
|
+
Wait time, in seconds, after a worker parent sends a \fBTERM\fR signal to its child, before it sends a \fBKILL\fR signal\.
|
|
86
|
+
.TP
|
|
87
|
+
\fBRUN_AT_EXIT_HOOKS\fR
|
|
88
|
+
Set this to run \fBat_exit\fR hooks in when worker child processes exit\.
|
|
89
|
+
.TP
|
|
90
|
+
\fBLOGGING\fR or \fBVERBOSE\fR
|
|
91
|
+
Enable verbose logging\.
|
|
92
|
+
.TP
|
|
93
|
+
\fBVVERBOSE\fR
|
|
94
|
+
Enable very verbose logging\.
|
|
81
95
|
.SH "AUTHOR"
|
|
82
|
-
Nicholas Evans
|
|
83
|
-
.
|
|
96
|
+
Nicholas Evans, et al\.
|
|
84
97
|
.SH "COPYRIGHT"
|
|
85
|
-
Copyright (C) 2010 by Nicholas Evans \fInick@
|
|
86
|
-
.
|
|
98
|
+
Copyright (C) 2010\-2026 by Nicholas Evans \fInick@rubinick\.dev\fR, et al\.
|
|
87
99
|
.SH "SEE ALSO"
|
|
88
100
|
resque\-pool\.yml(5)
|
data/man/resque-pool.1.ronn
CHANGED
|
@@ -3,7 +3,7 @@ resque-pool(1) -- resque worker pool management
|
|
|
3
3
|
|
|
4
4
|
## SYNOPSIS
|
|
5
5
|
|
|
6
|
-
`resque-pool` [
|
|
6
|
+
`resque-pool` [<OPTION...>]
|
|
7
7
|
|
|
8
8
|
## DESCRIPTION
|
|
9
9
|
|
|
@@ -16,17 +16,21 @@ directory.
|
|
|
16
16
|
|
|
17
17
|
## OPTIONS
|
|
18
18
|
|
|
19
|
+
### Basic options
|
|
20
|
+
|
|
19
21
|
* `-c, --config` <file>:
|
|
20
22
|
Uses the configuration specified in the <file> provided instead of
|
|
21
23
|
searching in the current and `config` directories for `resque-pool.yml`.
|
|
22
24
|
|
|
23
25
|
* `-a, --appname` <name>:
|
|
24
26
|
Specifies the app name to be used for logging and procline. If not
|
|
25
|
-
specified, this defaults to the current working directory.
|
|
27
|
+
specified, this defaults to the name of the current working directory.
|
|
26
28
|
|
|
27
|
-
* `-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
* `-E, --environment` <name>:
|
|
30
|
+
Specifies the environment <name> to be set for `RAILS_ENV`, `RACK_ENV`
|
|
31
|
+
and `RESQUE_ENV` which will be passed on to the pooled resque workers.
|
|
32
|
+
|
|
33
|
+
### Logging options
|
|
30
34
|
|
|
31
35
|
* `-o, --stdout` <file>:
|
|
32
36
|
Writes the normal log output to <file> instead of printing to the
|
|
@@ -41,13 +45,35 @@ directory.
|
|
|
41
45
|
* `--nosync`
|
|
42
46
|
Allows writes to `stdout` and `stderr` to be buffered.
|
|
43
47
|
|
|
48
|
+
### Daemon options
|
|
49
|
+
|
|
50
|
+
* `-d, --daemon`:
|
|
51
|
+
Runs `resque-pool` in the background as a daemon process. This will
|
|
52
|
+
redirect `stdout` and `stderr` to log files and write a PID file.
|
|
53
|
+
|
|
54
|
+
* `-k, --kill-others`:
|
|
55
|
+
Shutdown any other Resque Pools on startup.
|
|
56
|
+
|
|
44
57
|
* `-p, --pidfile` <file>:
|
|
45
58
|
Writes the PID to the <file>. When running as a daemon this defaults
|
|
46
59
|
to `tmp/pids/resque-pool.pid`.
|
|
47
60
|
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
* `--no-pidfile` <file>:
|
|
62
|
+
Do not use a PID file, even when daemonized.
|
|
63
|
+
|
|
64
|
+
* `-l, --lock` <file>:
|
|
65
|
+
Obtain a lock on a file that will be held for the lifetime of the process.
|
|
66
|
+
This aids in concurrent daemonized deployment with some process managers
|
|
67
|
+
since multiple pools can share a lock, but not a pidfile.
|
|
68
|
+
|
|
69
|
+
* `-H, --hot-swap`:
|
|
70
|
+
Set appropriate defaults to hot-swap a new pool for a running pool. This is
|
|
71
|
+
an alias for `--no-pidfile --lock tmp/resque-pool.lock --kill-others`.
|
|
72
|
+
|
|
73
|
+
* `--single-process-group`:
|
|
74
|
+
Workers remain in the same process group as the master.
|
|
75
|
+
|
|
76
|
+
### Signal handling options
|
|
51
77
|
|
|
52
78
|
* `--term-graceful-wait`:
|
|
53
79
|
Configure TERM signal handling so the master will gracefully request worker
|
|
@@ -64,28 +90,47 @@ directory.
|
|
|
64
90
|
shut downs (via `INT`) and shut itself down immediately. This is the
|
|
65
91
|
default `TERM` signal behavior.
|
|
66
92
|
|
|
67
|
-
|
|
93
|
+
### Worker options
|
|
94
|
+
|
|
95
|
+
* `-s, --spawn-delay` <milliseconds>:
|
|
96
|
+
Delay in milliseconds between spawning missing workers.
|
|
97
|
+
|
|
98
|
+
## ENVIRONMENT
|
|
99
|
+
|
|
100
|
+
Environment variables may be used for some configuration.
|
|
68
101
|
|
|
69
|
-
* `
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
102
|
+
* `RESQUE_POOL_CONFIG`:
|
|
103
|
+
Sets the config file file. Overridden by `--config`.
|
|
104
|
+
* `RESQUE_SINGLE_PGRP`:
|
|
105
|
+
Enables `--single-process-group` behavior.
|
|
106
|
+
* `TERM_CHILD`:
|
|
107
|
+
Enables `--term-graceful-wait` behavior and uses `TERM` to stop workers.
|
|
108
|
+
Resque workers inherit `TERM_CHILD` so `resque-pool` will use `TERM` to stop
|
|
109
|
+
them.
|
|
73
110
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Fixed `-c, --config` option.
|
|
111
|
+
The following environment variables are not _directly_ used by `resque-pool`,
|
|
112
|
+
but are used to explicitly configure `resque` worker processes. See the
|
|
113
|
+
`resque` documentation for detailed description.
|
|
78
114
|
|
|
79
|
-
* `
|
|
80
|
-
|
|
115
|
+
* `INTERVAL`, `MAX_INTERVAL`, `MIN_INTERVAL`, `BACKOFF_INTERVAL`:
|
|
116
|
+
The job polling interval for idle workers, in seconds.
|
|
117
|
+
* `RESQUE_TERM_TIMEOUT`:
|
|
118
|
+
Wait time, in seconds, after a worker parent sends a `TERM` signal to its
|
|
119
|
+
child, before it sends a `KILL` signal.
|
|
120
|
+
* `RUN_AT_EXIT_HOOKS`:
|
|
121
|
+
Set this to run `at_exit` hooks in when worker child processes exit.
|
|
122
|
+
* `LOGGING` or `VERBOSE`:
|
|
123
|
+
Enable verbose logging.
|
|
124
|
+
* `VVERBOSE`:
|
|
125
|
+
Enable very verbose logging.
|
|
81
126
|
|
|
82
127
|
## AUTHOR
|
|
83
128
|
|
|
84
|
-
Nicholas Evans
|
|
129
|
+
Nicholas Evans, et al.
|
|
85
130
|
|
|
86
131
|
## COPYRIGHT
|
|
87
132
|
|
|
88
|
-
Copyright (C) 2010 by Nicholas Evans <nick@
|
|
133
|
+
Copyright (C) 2010-2026 by Nicholas Evans <nick@rubinick.dev>, et al.
|
|
89
134
|
|
|
90
135
|
## SEE ALSO
|
|
91
136
|
|
data/man/resque-pool.yml.5
CHANGED
|
@@ -1,46 +1,31 @@
|
|
|
1
|
-
.\" generated with Ronn/v0.
|
|
2
|
-
.\" http://github.com/
|
|
3
|
-
.
|
|
4
|
-
.TH "RESQUE\-POOL\.YML" "5" "May 2012" "RESQUE-POOL 0.3.0.DEV" "RESQUE-POOL"
|
|
5
|
-
.
|
|
1
|
+
.\" generated with Ronn-NG/v0.10.1
|
|
2
|
+
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
|
3
|
+
.TH "RESQUE\-POOL\.YML" "5" "February 2026" "RESQUE-POOL 0.7.1" "RESQUE-POOL"
|
|
6
4
|
.SH "NAME"
|
|
7
5
|
\fBresque\-pool\.yml\fR \- resque\-pool pool configuration
|
|
8
|
-
.
|
|
9
6
|
.SH "SYNOPSIS"
|
|
10
7
|
\fBresque\-pool\.yml\fR
|
|
11
|
-
.
|
|
12
8
|
.br
|
|
13
9
|
\fBconfig/resque\-pool\.yml\fR
|
|
14
|
-
.
|
|
15
10
|
.SH "DESCRIPTION"
|
|
16
11
|
resque\-pool(1) reads pool configuration data from \fBresque\-pool\.yml\fR (or the file specified with \fB\-c\fR on the command line)\. The file contains queue\-worker\-count pairs, one per line\. The configuration file supports both using root level defaults as well as environment specific overrides (\fBRACK_ENV\fR, \fBRAILS_ENV\fR, and \fBRESQUE_ENV\fR environment variables can be used to determine environment)\.
|
|
17
|
-
.
|
|
18
12
|
.P
|
|
19
13
|
An example configuration
|
|
20
|
-
.
|
|
21
14
|
.IP "" 4
|
|
22
|
-
.
|
|
23
15
|
.nf
|
|
24
|
-
|
|
25
16
|
foo: 1
|
|
26
17
|
bar: 2
|
|
27
18
|
"foo,bar,baz": 1
|
|
28
19
|
|
|
29
20
|
production:
|
|
30
21
|
"foo,bar,baz": 4
|
|
31
|
-
.
|
|
32
22
|
.fi
|
|
33
|
-
.
|
|
34
23
|
.IP "" 0
|
|
35
|
-
.
|
|
36
24
|
.P
|
|
37
25
|
will create 7 workers in production and 4 in other environment configurations\. The simpler worker definition \fBfoo: 1\fR will create 1 worker for the \fBfoo\fR queue, the more complicated \fBfoo,bar,baz: 1\fR will create 1 worker for the queues \fBfoo\fR, \fBbar\fR and \fBbaz\fR\.
|
|
38
|
-
.
|
|
39
26
|
.SH "AUTHOR"
|
|
40
27
|
Nicholas Evans
|
|
41
|
-
.
|
|
42
28
|
.SH "COPYRIGHT"
|
|
43
|
-
Copyright (C) 2010 by Nicholas Evans \fInick@
|
|
44
|
-
.
|
|
29
|
+
Copyright (C) 2010\-2026 by Nicholas Evans \fInick@rubinick\.dev\fR, et al\.
|
|
45
30
|
.SH "SEE ALSO"
|
|
46
31
|
resque\-pool(1)
|
data/man/resque-pool.yml.5.ronn
CHANGED
|
@@ -9,7 +9,8 @@ resque-pool.yml(5) -- resque-pool pool configuration
|
|
|
9
9
|
## DESCRIPTION
|
|
10
10
|
|
|
11
11
|
resque-pool(1) reads pool configuration data from `resque-pool.yml` (or
|
|
12
|
-
the file specified with `-c` on the command line). The file contains
|
|
12
|
+
the file specified with `-c` on the command line). The file contains
|
|
13
|
+
queue-worker-count pairs, one per line. The configuration file supports both
|
|
13
14
|
using root level defaults as well as environment specific overrides
|
|
14
15
|
(`RACK_ENV`, `RAILS_ENV`, and `RESQUE_ENV` environment variables can be used
|
|
15
16
|
to determine environment).
|
|
@@ -34,7 +35,7 @@ Nicholas Evans
|
|
|
34
35
|
|
|
35
36
|
## COPYRIGHT
|
|
36
37
|
|
|
37
|
-
Copyright (C) 2010 by Nicholas Evans <nick@
|
|
38
|
+
Copyright (C) 2010-2026 by Nicholas Evans <nick@rubinick.dev>, et al.
|
|
38
39
|
|
|
39
40
|
## SEE ALSO
|
|
40
41
|
|
data/resque-pool.gemspec
CHANGED
|
@@ -4,19 +4,20 @@ Gem::Specification.new do |spec|
|
|
|
4
4
|
spec.name = "resque-pool"
|
|
5
5
|
spec.version = Resque::Pool::VERSION
|
|
6
6
|
spec.authors = ["nicholas a. evans",]
|
|
7
|
-
spec.email = ["nick@
|
|
7
|
+
spec.email = ["nick@rubinick.dev"]
|
|
8
8
|
|
|
9
9
|
spec.summary = "quickly and easily fork a pool of resque workers"
|
|
10
10
|
spec.description = <<-EOF
|
|
11
11
|
quickly and easily fork a pool of resque workers,
|
|
12
12
|
saving memory (w/REE) and monitoring their uptime
|
|
13
13
|
EOF
|
|
14
|
-
spec.homepage = "http://github.com/
|
|
14
|
+
spec.homepage = "http://github.com/resque/resque-pool"
|
|
15
15
|
spec.license = 'MIT'
|
|
16
16
|
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
|
-
spec.metadata["source_code_uri"] = "http://github.com/
|
|
19
|
-
spec.metadata["changelog_uri"] = "https://github.com/resque/resque/blob/
|
|
18
|
+
spec.metadata["source_code_uri"] = "http://github.com/resque/resque-pool"
|
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/resque/resque-pool/blob/main/Changelog.md"
|
|
20
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
20
21
|
|
|
21
22
|
# Specify which files should be added to the gem when it is released.
|
|
22
23
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -27,16 +28,16 @@ Gem::Specification.new do |spec|
|
|
|
27
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
28
29
|
spec.require_paths = ["lib"]
|
|
29
30
|
|
|
30
|
-
spec.required_ruby_version = '>=
|
|
31
|
+
spec.required_ruby_version = '>= 3.0'
|
|
31
32
|
|
|
32
|
-
spec.add_dependency "resque", ">=
|
|
33
|
-
spec.add_dependency "rake", ">= 10.0"
|
|
33
|
+
spec.add_dependency "resque", ">= 2.2", "< 4"
|
|
34
|
+
spec.add_dependency "rake", ">= 10.0"
|
|
34
35
|
|
|
35
|
-
spec.add_development_dependency "bundler"
|
|
36
|
-
spec.add_development_dependency "rspec"
|
|
37
|
-
spec.add_development_dependency "cucumber"
|
|
38
|
-
spec.add_development_dependency "aruba"
|
|
39
|
-
spec.add_development_dependency "ronn"
|
|
36
|
+
spec.add_development_dependency "bundler"
|
|
37
|
+
spec.add_development_dependency "rspec"
|
|
38
|
+
spec.add_development_dependency "cucumber"
|
|
39
|
+
spec.add_development_dependency "aruba"
|
|
40
|
+
spec.add_development_dependency "ronn-ng"
|
|
40
41
|
spec.add_development_dependency "mustache"
|
|
41
42
|
|
|
42
43
|
end
|