Skip to content
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

Set database poolsize via rails_max_threads #23528

Merged
merged 1 commit into from Feb 10, 2016
Merged

Conversation

bensheldon
Copy link
Contributor

Introduced in #23057 was an environment variable RAILS_MAX_THREADS that is used to set the number of threads in puma, the default web server. The default value for this environment variable is 5 because that matches the default number of ActiveRecord threads. A mismatch between the database poolsize and the puma thread-count results in ActiveRecord::ConnectionTimeoutError.

This PR proposes to also reuse the RAILS_MAX_THREADS when setting the database pool size to better ensure that the values are in sync.

@maclover7
Copy link
Contributor

cc @schneems

@schneems
Copy link
Member

I'm for this, it keeps the default the same as it always was, but plays nice with the puma config. Can you rebase this to 1 commit?

@bensheldon
Copy link
Contributor Author

@schneems I've rebased to a single commit.

@schneems
Copy link
Member

Thanks!

schneems added a commit that referenced this pull request Feb 10, 2016
Set database poolsize via rails_max_threads
@schneems schneems merged commit 391061a into rails:master Feb 10, 2016
@bensheldon bensheldon deleted the patch-1 branch February 10, 2016 20:47
@rhymes rhymes mentioned this pull request Dec 5, 2020
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants