-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarification on max_threads option #538
Comments
@hmnhf thanks for opening this Issue! The Readme was recently updated to try to explain how to calculate total threads (#525) and I think it exposed a conceptual problem. Briefly to answer your question: The name predates the ability to configure multiple query pools within a single process (e.g. the The example given for defining To address this:
|
@bensheldon so if I have the following queue "high_priority:7;default:4;low_priority:2;*" and GOOD_JOB_MAX_THREADS = 5 that means: 7 threads for high priority Additionally, goodjob needs With GoodJob running separately from the web process, based on the above example the database.yml should have:
Is that right? I spent the last couple hours reading through the readme and various issues, and that's what I have deduced.... |
@philipqnguyen yep, that's correct number of threads GoodJob will need from the database and the minimum value you should safely have in your I'm also recommending that people don't set the minimum but rather just set like 50 or 100 and don't worry about it from the perspective of the application. You'll need to have those connections available from the database, but trying to set a minimum in the For example, if you're using Active Record |
Thank you for confirming @bensheldon |
Hi and thanks for this awesome gem!
I've become a bit confused about the
max_threads
option.From reading the following two sections, at first I thought
max_threads
is a global option that defines the maximum number of threads across all queues. (Meaning that if there are two queues named A and B, their combined total threads' count won't exceed the number ofmax_threads
.)But after reading the following two sections, I figured it's probably the default max value for each queue's threads:
But, then again in the Database Connections section, there's the following part which gives the impression that
max_threads
is the max number of threads across all different queues.And then, there's the description on how to calculate the number of required threads by GoodJob to be set as
GOOD_JOB_MAX_THREADS
.Assuming that I've understood this correctly, I think the confusion comes from the fact that the
max_threads
option and theGOOD_JOB_MAX_THREADS
used in the pool size setting can be two different values. In other words, their name could bedefault_max_threads_per_queue
andGOOD_JOB_REQUIRED_THREADS
.Have I misunderstood something or is this correct?
The text was updated successfully, but these errors were encountered: