How to split MySQL connection between parents and children using Resque?

By default, in Resque, the parent forks and child processes create a new database connection.

This might work, but if you have dozens of employees, MySQL cannot keep many connections open and starts throwing errors.

What would be the solution for children to use a MySQL connection with their parents?

+6
source share
1 answer

Unfortunately, there is no reliable way to split the MySQL connection with the parent into children. I think you have two options:

  • The easiest solution is to configure your MySQL server so that it can accept more connections (for example: http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html ).
  • Look for alternatives to Resque and / or design (for example: beanstalkd, Redis, etc.) that avoid creating multiple connections to the MySQL server.
+3
source

Source: https://habr.com/ru/post/905194/


All Articles