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

bensheldon commented Feb 6, 2016

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 maclover7 added the railties label Feb 6, 2016
@maclover7
Copy link
Member

maclover7 commented Feb 6, 2016

@schneems
Copy link
Member

schneems commented Feb 10, 2016

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 bensheldon force-pushed the bensheldon:patch-1 branch to 1273fc9 Feb 10, 2016
@bensheldon
Copy link
Contributor Author

bensheldon commented Feb 10, 2016

@schneems I've rebased to a single commit.

@schneems
Copy link
Member

schneems commented Feb 10, 2016

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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bensheldon bensheldon deleted the bensheldon:patch-1 branch Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.