Skip to content

Commit 8c13482

Browse files
chore: Add specific worker backend notes and table with collected metrics for each backend (#228)
We needed a place to document a gotcha recently discovered with rescue-scheduler that wasn't loading our latency extension, so I added another sub-section under "Worker adapters" for that. This also takes the opportunity to document what each adapter collects specifically, so it's easier to visualize where queue latency vs queue depth is available, and which can support busy (if enabled).
1 parent 6fd131c commit 8c13482

File tree

11 files changed

+297
-266
lines changed

11 files changed

+297
-266
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ For most apps, no additional configuration is needed. See the [configuration](#c
7272

7373
Note that if you aren't using Rails, you'll need to start the reporter manually. See below.
7474

75+
### Specific worker backend notes
76+
77+
#### Resque
78+
79+
If you're using `resque-scheduler` and their [standalone executable](https://github.com/resque/resque-scheduler?tab=readme-ov-file#standalone-executable) approach, add a `require "judoscale-resque"` to your executable, or require your entire Rails application. This ensures the Judoscale extension that stores latency for each job gets properly loaded within the scheduler process, otherwise metrics may not be reported appropriately from the scheduler.
80+
7581
## Worker-only apps
7682

7783
If your app doesn't have a web process, you don't _have_ to include the "judoscale-rails" gem. If you omit it, you'll need to start the reporter manually:
@@ -93,10 +99,23 @@ The reporter runs in its own thread so your web requests and background jobs are
9399
- Judoscale gem versions
94100
- Dyno name (example: web.1)
95101
- PID
96-
- Collection of queue time metrics (time and milliseconds)
102+
- Collection of queue time metrics (time and milliseconds) for web
103+
- Collection of queue time and/or queue depth metrics, and busy metrics (if enabled), for workers (see below)
97104

98105
Judoscale aggregates and stores this information to power the autoscaler algorithm and dashboard visualizations.
99106

107+
### What data is collected for each worker adapter?
108+
109+
| adapter | queue time | queue depth | busy (if enabled) |
110+
|-----------------------|------------|-------------|-------------------|
111+
| judoscale-sidekiq ||||
112+
| judoscale-solid_queue ||||
113+
| judoscale-resque ||||
114+
| judoscale-delayed_job ||||
115+
| judoscale-good_job ||||
116+
| judoscale-que ||||
117+
| judoscale-shoryuken ||||
118+
100119
## Migrating from `rails_autoscale_agent`
101120

102121
The migration from `rails_autoscale_agent` to `judoscale-rails` (+ your job framework gem) is typically a single step: replace the `gem "rails_autoscale_agent"` in your Gemfile with `gem "judoscale-rails"` _and_ the appropriate `judoscale-*` package for your back-end job framework (`sidekiq`, `resque`, `delayed_job`, `good_job`, or `que`) or see the [Installation](#installation) section above for further specifics. If you previously had any custom configuration for the `rails_autoscale_agent`, please note that we now use a `configure` block as shown below.

sample-apps/delayed_job-sample/Gemfile.lock

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
PATH
22
remote: ../../judoscale-delayed_job
33
specs:
4-
judoscale-delayed_job (1.8.1)
4+
judoscale-delayed_job (1.8.2)
55
delayed_job_active_record (>= 4.0)
6-
judoscale-ruby (= 1.8.1)
6+
judoscale-ruby (= 1.8.2)
77

88
PATH
99
remote: ../../judoscale-rails
1010
specs:
11-
judoscale-rails (1.8.1)
12-
judoscale-ruby (= 1.8.1)
11+
judoscale-rails (1.8.2)
12+
judoscale-ruby (= 1.8.2)
1313
railties
1414

1515
PATH
1616
remote: ../../judoscale-ruby
1717
specs:
18-
judoscale-ruby (1.8.1)
18+
judoscale-ruby (1.8.2)
1919

2020
GEM
2121
remote: https://rubygems.org/
2222
specs:
23-
actionpack (7.0.8.5)
24-
actionview (= 7.0.8.5)
25-
activesupport (= 7.0.8.5)
23+
actionpack (7.0.8.6)
24+
actionview (= 7.0.8.6)
25+
activesupport (= 7.0.8.6)
2626
rack (~> 2.0, >= 2.2.4)
2727
rack-test (>= 0.6.3)
2828
rails-dom-testing (~> 2.0)
2929
rails-html-sanitizer (~> 1.0, >= 1.2.0)
30-
actionview (7.0.8.5)
31-
activesupport (= 7.0.8.5)
30+
actionview (7.0.8.6)
31+
activesupport (= 7.0.8.6)
3232
builder (~> 3.1)
3333
erubi (~> 1.4)
3434
rails-dom-testing (~> 2.0)
3535
rails-html-sanitizer (~> 1.1, >= 1.2.0)
36-
activemodel (7.0.8.5)
37-
activesupport (= 7.0.8.5)
38-
activerecord (7.0.8.5)
39-
activemodel (= 7.0.8.5)
40-
activesupport (= 7.0.8.5)
41-
activesupport (7.0.8.5)
36+
activemodel (7.0.8.6)
37+
activesupport (= 7.0.8.6)
38+
activerecord (7.0.8.6)
39+
activemodel (= 7.0.8.6)
40+
activesupport (= 7.0.8.6)
41+
activesupport (7.0.8.6)
4242
concurrent-ruby (~> 1.0, >= 1.0.2)
4343
i18n (>= 1.6, < 2)
4444
minitest (>= 5.1)
@@ -60,21 +60,21 @@ GEM
6060
erubi (1.13.0)
6161
i18n (1.14.6)
6262
concurrent-ruby (~> 1.0)
63-
loofah (2.22.0)
63+
loofah (2.23.1)
6464
crass (~> 1.0.2)
6565
nokogiri (>= 1.12.0)
6666
method_source (1.1.0)
6767
minitest (5.25.1)
6868
mustermann (3.0.3)
6969
ruby2_keywords (~> 0.0.1)
70-
nio4r (2.7.3)
70+
nio4r (2.7.4)
7171
nokogiri (1.16.7-arm64-darwin)
7272
racc (~> 1.4)
7373
nokogiri (1.16.7-x86_64-darwin)
7474
racc (~> 1.4)
7575
nokogiri (1.16.7-x86_64-linux)
7676
racc (~> 1.4)
77-
pg (1.5.8)
77+
pg (1.5.9)
7878
puma (5.6.9)
7979
nio4r (~> 2.0)
8080
racc (1.8.1)
@@ -91,9 +91,9 @@ GEM
9191
rails-html-sanitizer (1.6.0)
9292
loofah (~> 2.21)
9393
nokogiri (~> 1.14)
94-
railties (7.0.8.5)
95-
actionpack (= 7.0.8.5)
96-
activesupport (= 7.0.8.5)
94+
railties (7.0.8.6)
95+
actionpack (= 7.0.8.6)
96+
activesupport (= 7.0.8.6)
9797
method_source
9898
rake (>= 12.2)
9999
thor (~> 1.0)
@@ -109,13 +109,14 @@ GEM
109109
tilt (2.4.0)
110110
tzinfo (2.0.6)
111111
concurrent-ruby (~> 1.0)
112-
zeitwerk (2.7.0)
112+
zeitwerk (2.7.1)
113113

114114
PLATFORMS
115115
arm64-darwin-20
116116
arm64-darwin-21
117117
arm64-darwin-22
118118
arm64-darwin-23
119+
arm64-darwin-24
119120
x86_64-darwin-21
120121
x86_64-linux
121122

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,98 @@
11
PATH
22
remote: ../../judoscale-good_job
33
specs:
4-
judoscale-good_job (1.8.1)
4+
judoscale-good_job (1.8.2)
55
good_job (>= 3.0, < 5.0)
6-
judoscale-ruby (= 1.8.1)
6+
judoscale-ruby (= 1.8.2)
77

88
PATH
99
remote: ../../judoscale-rails
1010
specs:
11-
judoscale-rails (1.8.1)
12-
judoscale-ruby (= 1.8.1)
11+
judoscale-rails (1.8.2)
12+
judoscale-ruby (= 1.8.2)
1313
railties
1414

1515
PATH
1616
remote: ../../judoscale-ruby
1717
specs:
18-
judoscale-ruby (1.8.1)
18+
judoscale-ruby (1.8.2)
1919

2020
GEM
2121
remote: https://rubygems.org/
2222
specs:
23-
actionpack (7.0.8.4)
24-
actionview (= 7.0.8.4)
25-
activesupport (= 7.0.8.4)
23+
actionpack (7.0.8.6)
24+
actionview (= 7.0.8.6)
25+
activesupport (= 7.0.8.6)
2626
rack (~> 2.0, >= 2.2.4)
2727
rack-test (>= 0.6.3)
2828
rails-dom-testing (~> 2.0)
2929
rails-html-sanitizer (~> 1.0, >= 1.2.0)
30-
actionview (7.0.8.4)
31-
activesupport (= 7.0.8.4)
30+
actionview (7.0.8.6)
31+
activesupport (= 7.0.8.6)
3232
builder (~> 3.1)
3333
erubi (~> 1.4)
3434
rails-dom-testing (~> 2.0)
3535
rails-html-sanitizer (~> 1.1, >= 1.2.0)
36-
activejob (7.0.8.4)
37-
activesupport (= 7.0.8.4)
36+
activejob (7.0.8.6)
37+
activesupport (= 7.0.8.6)
3838
globalid (>= 0.3.6)
39-
activemodel (7.0.8.4)
40-
activesupport (= 7.0.8.4)
41-
activerecord (7.0.8.4)
42-
activemodel (= 7.0.8.4)
43-
activesupport (= 7.0.8.4)
44-
activesupport (7.0.8.4)
39+
activemodel (7.0.8.6)
40+
activesupport (= 7.0.8.6)
41+
activerecord (7.0.8.6)
42+
activemodel (= 7.0.8.6)
43+
activesupport (= 7.0.8.6)
44+
activesupport (7.0.8.6)
4545
concurrent-ruby (~> 1.0, >= 1.0.2)
4646
i18n (>= 1.6, < 2)
4747
minitest (>= 5.1)
4848
tzinfo (~> 2.0)
4949
builder (3.3.0)
50-
concurrent-ruby (1.3.3)
50+
concurrent-ruby (1.3.4)
5151
crass (1.0.6)
5252
debug (1.9.2)
5353
irb (~> 1.10)
5454
reline (>= 0.3.8)
5555
erubi (1.13.0)
5656
et-orbi (1.2.11)
5757
tzinfo
58-
fugit (1.11.0)
58+
fugit (1.11.1)
5959
et-orbi (~> 1, >= 1.2.11)
6060
raabro (~> 1.4)
6161
globalid (1.2.1)
6262
activesupport (>= 6.1)
63-
good_job (3.99.0)
63+
good_job (3.99.1)
6464
activejob (>= 6.0.0)
6565
activerecord (>= 6.0.0)
6666
concurrent-ruby (>= 1.0.2)
6767
fugit (>= 1.1)
6868
railties (>= 6.0.0)
6969
thor (>= 0.14.1)
70-
i18n (1.14.5)
70+
i18n (1.14.6)
7171
concurrent-ruby (~> 1.0)
7272
io-console (0.7.2)
73-
irb (1.12.0)
74-
rdoc
73+
irb (1.14.1)
74+
rdoc (>= 4.0.0)
7575
reline (>= 0.4.2)
76-
loofah (2.22.0)
76+
loofah (2.23.1)
7777
crass (~> 1.0.2)
7878
nokogiri (>= 1.12.0)
7979
method_source (1.1.0)
80-
minitest (5.24.1)
81-
nio4r (2.7.1)
82-
nokogiri (1.16.6-arm64-darwin)
80+
minitest (5.25.1)
81+
nio4r (2.7.4)
82+
nokogiri (1.16.7-arm64-darwin)
8383
racc (~> 1.4)
84-
nokogiri (1.16.6-x86_64-darwin)
84+
nokogiri (1.16.7-x86_64-darwin)
8585
racc (~> 1.4)
86-
nokogiri (1.16.6-x86_64-linux)
86+
nokogiri (1.16.7-x86_64-linux)
8787
racc (~> 1.4)
88-
pg (1.5.6)
88+
pg (1.5.9)
8989
psych (5.1.2)
9090
stringio
91-
puma (5.6.8)
91+
puma (5.6.9)
9292
nio4r (~> 2.0)
9393
raabro (1.4.0)
94-
racc (1.8.0)
95-
rack (2.2.9)
94+
racc (1.8.1)
95+
rack (2.2.10)
9696
rack-test (2.1.0)
9797
rack (>= 1.3)
9898
rails-dom-testing (2.2.0)
@@ -102,29 +102,30 @@ GEM
102102
rails-html-sanitizer (1.6.0)
103103
loofah (~> 2.21)
104104
nokogiri (~> 1.14)
105-
railties (7.0.8.4)
106-
actionpack (= 7.0.8.4)
107-
activesupport (= 7.0.8.4)
105+
railties (7.0.8.6)
106+
actionpack (= 7.0.8.6)
107+
activesupport (= 7.0.8.6)
108108
method_source
109109
rake (>= 12.2)
110110
thor (~> 1.0)
111111
zeitwerk (~> 2.5)
112112
rake (13.2.1)
113-
rdoc (6.6.3.1)
113+
rdoc (6.7.0)
114114
psych (>= 4.0.0)
115-
reline (0.5.4)
115+
reline (0.5.10)
116116
io-console (~> 0.5)
117-
stringio (3.1.0)
118-
thor (1.3.1)
117+
stringio (3.1.1)
118+
thor (1.3.2)
119119
tzinfo (2.0.6)
120120
concurrent-ruby (~> 1.0)
121-
zeitwerk (2.6.16)
121+
zeitwerk (2.7.1)
122122

123123
PLATFORMS
124124
arm64-darwin-20
125125
arm64-darwin-21
126126
arm64-darwin-22
127127
arm64-darwin-23
128+
arm64-darwin-24
128129
x86_64-darwin-21
129130
x86_64-linux
130131

@@ -144,4 +145,4 @@ DEPENDENCIES
144145
railties (~> 7.0.1)
145146

146147
BUNDLED WITH
147-
2.5.11
148+
2.5.22

0 commit comments

Comments
 (0)