4

I have an app currently on a 48GB (12 vCPU) DO server, which is struggling with connection sizes. We have an API that gets hit ever 5 minutes by 350~ IoT devices and it gets added to a background queue for log processing.

I have tried using both delayed_job and sidekiq for background processing, however both create so many database connections that it exceeds the postgresql default 100 connection limit and causes downtime. I have had to temporarily remove this background processing. Without the background processing, we use around 60-65 postgresql connections.

  • I am running Dokku 0.6.5
  • Postgresql was installed using this dokku plugin
  • App is Ruby on Rails
  • My database.yml pool size is set to 5, my puma worker threads are 5 so I followed herokus recommendation that these should match.t

I am not conclusive in how PgBouncer can be installed on a dokku app that is running postgresql through a plugin. Currently, my only idea is to upgrade my dokku to 0.15.0, which then has buildpack support and I can install the heroku PgBouncer buildpack.

I would greatly appreciate any insight on the best way to install PgBouncer with this set-up.

C. Short
  • 109
  • 5

0 Answers0