Skip to content

Commit 57ca919

Browse files
committed
Use Solid Queue async mode for reduced memory
1 parent 514f89b commit 57ca919

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gem "redis", "~> 5.4"
1515
gem "puma", "~> 6.6"
1616

1717
# Jobs
18-
gem "solid_queue"
18+
gem "solid_queue", github: "joshleblanc/solid_queue", branch: "async-mode"
1919

2020
# Assets
2121
gem "propshaft", github: "rails/propshaft"

Gemfile.lock

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ GIT
66
actionpack (>= 7.1.0)
77
railties (>= 7.1.0)
88

9+
GIT
10+
remote: https://github.com/joshleblanc/solid_queue.git
11+
revision: d122b5eb5ce26ea1cf1f5741a2c40a88cc02822d
12+
branch: async-mode
13+
specs:
14+
solid_queue (1.2.4)
15+
activejob (>= 7.1)
16+
activerecord (>= 7.1)
17+
concurrent-ruby (>= 1.3.1)
18+
fugit (~> 1.11)
19+
railties (>= 7.1)
20+
thor (>= 1.3.1)
21+
922
GIT
1023
remote: https://github.com/rails/importmap-rails.git
1124
revision: 51c1a531327fc04ed4552bb0fd523eb43561b817
@@ -345,13 +358,6 @@ GEM
345358
sentry-ruby (5.26.0)
346359
bigdecimal
347360
concurrent-ruby (~> 1.0, >= 1.0.2)
348-
solid_queue (1.2.4)
349-
activejob (>= 7.1)
350-
activerecord (>= 7.1)
351-
concurrent-ruby (>= 1.3.1)
352-
fugit (~> 1.11)
353-
railties (>= 7.1)
354-
thor (>= 1.3.1)
355361
sqlite3 (2.7.3-aarch64-linux-gnu)
356362
sqlite3 (2.7.3-arm64-darwin)
357363
sqlite3 (2.7.3-x86_64-darwin)
@@ -421,7 +427,7 @@ DEPENDENCIES
421427
selenium-webdriver
422428
sentry-rails
423429
sentry-ruby
424-
solid_queue
430+
solid_queue!
425431
sqlite3
426432
stimulus-rails
427433
thruster

Procfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
web: bundle exec thrust bin/start-app
1+
web: SOLID_QUEUE_IN_PUMA=true bundle exec thrust bin/start-app
22
redis: redis-server config/redis.conf
3-
workers: bundle exec bin/jobs

config/puma.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@
4747
# Allow puma to be restarted by `bin/rails restart` command.
4848
plugin :tmp_restart
4949

50-
# Run Solid Queue inside Puma in development (no separate bin/jobs process needed)
51-
plugin :solid_queue if Rails.env.development?
50+
# Run Solid Queue inside Puma (async mode = threads instead of forking processes)
51+
if ENV["SOLID_QUEUE_IN_PUMA"]
52+
plugin :solid_queue
53+
solid_queue_mode :async
54+
end
5255

5356
# Reset all membership connections
5457
Membership.disconnect_all

0 commit comments

Comments
 (0)