Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Increase good_job threads

Josh Pigford32d826c04736
diff --git a/config/database.yml b/config/database.yml
index 6e0652c4..0443207d 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -2,7 +2,7 @@ default: &default
adapter: postgresql
encoding: unicode
# 3 connections for Puma, 8 for GoodJob (in async mode, the default for self-hosters) = 11 connections
- pool: <%= ENV.fetch("DB_POOL_SIZE") { 11 } %>
+ pool: <%= ENV.fetch("DB_POOL_SIZE") { 13 } %>
host: <%= ENV.fetch("DB_HOST") { "127.0.0.1" } %>
port: <%= ENV.fetch("DB_PORT") { "5432" } %>
user: <%= ENV.fetch("POSTGRES_USER") { nil } %>
diff --git a/config/initializers/good_job.rb b/config/initializers/good_job.rb
index c6e3d33e..b3e8cc03 100644
--- a/config/initializers/good_job.rb
+++ b/config/initializers/good_job.rb
@@ -13,11 +13,11 @@ Rails.application.configure do
config.good_job.on_thread_error = ->(exception) { Rails.error.report(exception) }
- # 5 queue threads + 3 for job listener, cron, executor = 8 threads allocated
+ # 10 queue threads + 3 for job listener, cron, executor = 13 threads allocated
config.queues = {
- "latency_low" => { max_threads: 1, priority: 10 }, # ~30s jobs
- "latency_low,latency_medium" => { max_threads: 2, priority: 5 }, # ~1-2 min jobs
- "latency_low,latency_medium,latency_high" => { max_threads: 1, priority: 1 }, # ~5+ min jobs
+ "latency_low" => { max_threads: 3, priority: 10 }, # ~30s jobs
+ "latency_low,latency_medium" => { max_threads: 4, priority: 5 }, # ~1-2 min jobs
+ "latency_low,latency_medium,latency_high" => { max_threads: 2, priority: 1 }, # ~5+ min jobs
"*" => { max_threads: 1, priority: 0 } # fallback queue
}