-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Paralelism x database connections #569
Comments
Every thread requires its own database connection; this is a requirement of ActiveRecord / Postgres Adapter.
Running 3 of them in that configuration will use 6 x 3 = 18 database connections. I'd love if you have suggestions for improvements to the documentation: https://github.com/bensheldon/good_job#database-connections |
Hi @bensheldon ! Thank you for you feedback! 🤝 Now it's clear 💡 ! A last doubt, there is some different behavior if we define Here, we have some apps configured by this way 😢 is there some chance to produce errors or strange behavior in the scenario of standalones good_job processes with some max threads? Thanks again for your help! 🍻 |
GoodJob uses ActiveRecord's database connection pool to check out database connections. You want to make sure that ActiveRecord's database connection pool is equal-to or greater-than the number of threads/connections used by GoodJob. If the ActiveRecord database connection pool is insufficient, you'll see performance problems (while it waits for an available connection) or This is analogous to matching the ActiveRecord database connection pool size to puma threads. |
Hi @bensheldon! 👋
Thanks for your hard work on this gem!
If I run a
good_job start
process in production, with--max-threads=5
, the process will have 1 database connection and 5 possible parallel job processing with pool connection?Another scenario: If I run 3
good_job start
processes in production with--max-threads=5
, there will be 3 database connections and each connection with 5 possible parallels job processing?What is the behavior of good_job standalone processes, threads in each processes considering database connections?
Thanks a lot! 🍻
The text was updated successfully, but these errors were encountered: