Skip to content

Commit

Permalink
Increase the database connection pool in production
Browse files Browse the repository at this point in the history
Based on the puma README (https://github.com/puma/puma#configuration) it looks like the default
max thread count is 16.

According to Heroku's documentation (https://devcenter.heroku.com/articles/concurrency-and-database-connections#threaded-servers)
a reasonable default for Puma is the RAILS_MAX_THREADS value. I didn't find a MAX_THREADS value
for Sinatra, so I'm using Puma's default.
  • Loading branch information
Katrina Owen committed May 28, 2017
1 parent e725cef commit b6b9afc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
postgres: &postgres
adapter: postgresql
encoding: unicode
pool: 5
host: <%= ENV["DEV_DATABASE_HOST"] || "localhost" %>
port: 5432
username: exercism
Expand All @@ -15,6 +14,8 @@ test:
development:
<<: *postgres
database: exercism_development
pool: 5

production:
url: <%= ENV["DATABASE_URL"] %>
pool: 16

0 comments on commit b6b9afc

Please sign in to comment.