0
votes

I have one standard web dyno and worker dyno connected to the same standard 0 database.

The worker dyno runs background jobs that insert a lot of data into the database. I feel like I have noticed slower response times while browsing my site when the workers are running.

I'm always well below the 120 connection limit. Am I imagining this or does it have an impact on read time? If so, how do people mitigate it?

1

1 Answers

1
votes

From the database's perspective, there is no difference between connections originating from the web dynos and worker dynos; they're both just clients of the database.

If your worker dynos are doing heavy inserts all the time, then they could certainly impact query performance as this places a lot of load on the database; how this impacts your web response times is specific to your particular application.

I would recommend starting by looking at Heroku Postgres tools for database performance tuning. https://devcenter.heroku.com/articles/heroku-postgres-database-tuning

Without knowing more about your application I would say you could start with looking at the slowest queries related to your web requests and compare them to query time with and without the workers enabled.