How to increase ActiveRecord thread pool size on heroku

activerecord, connection-pooling, heroku

Solution

Simply add a `pool` query parameter to the `DATABASE_URL` in your heroku config. To set the pool size to 15 in your heroku app use something like:

`heroku config -s | awk '/^DATABASE_URL=/{print $0 "?pool=15"}' | xargs heroku config:add`

Problem

Normally I would set the pool size as ``` development: adapter: postgresql encoding: unicode database: openkitchen_development username: rails host: localhost pool: 10 password: ``` in database.yml. However heroku replaces the config file. I'm using girl_friday to do background db work and need to increase the thread pool size.

Original source