Question

I was using 2 web dynos 1 worker dyno and 1 resque dyno before My application was working fine. But suddenly I increase the total number of dynos made 4 web dynos , 2 resque dynos and 2 worker dynos. This hampers the performance of my application.

Some Times error messages

[NewRelic][02/04/14 04:33:18 +0000 163ac5c4-qwqq-4271-b38a-absajsg2323s (19)] ERROR : Mysql2::Error: User 'b0ffsaasbffa' has exceeded the 'max_user_connections' resource (current value: 15)

Please tell me what should I do ?

Was it helpful?

Solution

When you're running 4 dynos with 3 unicorn worker processes each you're using 12 connections there for a start. It sounds like you are using a DB plan that restricts the number of connections.

Heroku have a very good article on concurrency and how database connections work at - https://devcenter.heroku.com/articles/concurrency-and-database-connections which is worth reading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top