The ratio between available connections and used ones was not good.
mysql> SHOW GLOBAL VARIABLES LIKE 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set (0.08 sec)
mysql> SHOW GLOBAL STATUS LIKE 'max_used_connections';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 150 |
+----------------------+-------+
1 row in set (0.00 sec)
Made this change:
In /etc/my.cnf under the [mysqld] section add:
max_connections = 500
then either execute SET GLOBAL max_connections = 500; in MySQL or restart MySQL.
Result:
mysql> SET GLOBAL max_connections = 500;
Query OK, 0 rows affected (0.05 sec)
mysql> SHOW GLOBAL VARIABLES LIKE 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 500 |
+-----------------+-------+
1 row in set (0.00 sec)
Will try the backup/restore later and see how they go now, and update here, meanwhile if you have ideas please chime in.