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

Conversation

Projects
None yet
3 participants
@bensheldon
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

This comment has been minimized.

Show comment
Hide comment
Member

maclover7 commented Feb 6, 2016

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Feb 10, 2016

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?

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

This comment has been minimized.

Show comment
Hide comment
@bensheldon

bensheldon Feb 10, 2016

Contributor

@schneems I've rebased to a single commit.

Contributor

bensheldon commented Feb 10, 2016

@schneems I've rebased to a single commit.

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Feb 10, 2016

Member

Thanks!

Member

schneems commented Feb 10, 2016

Thanks!

schneems added a commit that referenced this pull request Feb 10, 2016

Merge pull request #23528 from bensheldon/patch-1
Set database poolsize via rails_max_threads

@schneems schneems merged commit 391061a into rails:master Feb 10, 2016

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