EMCECS / ecs-sync

ecs-sync is a bulk copy utility that can move data between various systems in parallel
Apache License 2.0
61 stars 22 forks source link

MySQL: ERROR 1040 (08004): Too many connections #77

Closed naravanis closed 3 years ago

naravanis commented 3 years ago

When i try to login to the database to check the errors on the clips I get Too many connections. When I restart the server I can connect to the database but the table and migration instance is gone so I cannot troubleshoot.

xiaoxin-ren commented 3 years ago

Do you mean all the tables in database ecs_sync are gone? Or just missing a few tables for the ongoing migration instances? Do you find any ERROR reported in /var/log/ecs-sync/ecs-sync.log? If "Db File"(in Sync Option) is configured inside a sync Job, the progress will be saved into a SQLite Database instead of MariaDB, you might check that as well. If no clue from above information, would you please open a service ticket to get best support? Please contact us if you need further assistance.

xiaoxin-ren commented 3 years ago

@naravanis, regarding the issue reported in issue title, how is the max_connections configured in MariaDB? The default CFG is 1000, you could check by below cmd.

# grep max_connections /etc/my.cnf.d/ecs-sync.cnf
max_connections=1000

Please verify effective CFG in MariaDB as below. If it does not match above, a possible reason could be Open File Limit, you might refer to https://mariadb.com/kb/en/systemd/#configuring-the-open-files-limit and tune LimitNOFILE accordingly.

MariaDB [(none)]> select @@max_connections;
+-------------------+
| @@max_connections |
+-------------------+
|              1000 |
+-------------------+
1 row in set (0.00 sec)

If matches, you should consider tuning the migration load, or increasing max_connections in ecs-sync.cnf.

twincitiesguy commented 3 years ago

Closing due to inactivity

FYI, there are a few things that can impact this. One would be to make sure active jobs are cleaned up (deleted from the list), as it may be possible they inadvertently hang on to DB connections if the job fails for an unexpected reason.

It could also be an issue with the MariaDB/MySQL configuration. For that type of issue, I would defer to the MySQL docs (perhaps start here: https://dev.mysql.com/doc/refman/8.0/en/too-many-connections.html)