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

Make DB pool size configurable based on instance role #1848

Merged
merged 1 commit into from
Dec 7, 2017

Conversation

jgrevich
Copy link
Member

@jgrevich jgrevich commented Dec 7, 2017

Why

  • Workers need a 5x larger pool than the IdP hosts hence we need a way to configure the pool size based on instance role.

How

  • Use a conditional to set the pool size based on the instance role type.

@@ -5,7 +5,7 @@ postgresql: &postgresql
port: 5432

defaults: &defaults
pool: 5
pool: <%= (File.exist?('/etc/login.gov/info') && File.read('/etc/login.gov/info/role').chomp == 'worker') ? 26 : 5 %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on setting this for just the prod environment, and not the default environment?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this for other ends too (pt and sometimes staging)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what Jonathan meant by environment was "development", "test", and "production". All the lower envs are running in the Rails "production" environment. So, he's asking to make the change in the "production" section at the bottom of this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, that makes sense. Sorry for misunderstanding @jmhooper and thanks for clueing me in @monfresh!

__Why__

* Workers need a 5x larger pool than the IdP hosts hence we need a way to
configure the pool size based on instance role.

__How__

* Use a conditional to set the pool size based on the instance role type.
@jgrevich jgrevich force-pushed the jjg/fix/configurable-db-pool-size branch from 0f8973c to 2b8160d Compare December 7, 2017 21:18
@jgrevich
Copy link
Member Author

jgrevich commented Dec 7, 2017

Updated so the config is only in rails production envs. This should be good to go.

Copy link
Contributor

@monfresh monfresh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@monfresh monfresh merged commit d04487a into master Dec 7, 2017
@monfresh monfresh deleted the jjg/fix/configurable-db-pool-size branch December 7, 2017 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants