Page 1 of 1

Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections

Posted: Sun Oct 14, 2018 8:30 am
by scarygary
Zoneminder 1.32.1 running on Ubuntu 16.04.5. Never had this issue before. max_connections was commented out in /etc/mysql/my.cnf.
I stopped zoneminder, set it to 200 and restarted mysql and zoneminder just to be on the safe side. Hoping that's the end of it.

Re: Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections

Posted: Sun Oct 14, 2018 12:40 pm
by knight-of-ni
The zoneminder navbar tells you how many connections there are currently and what your max is. You should keep an eye on that.

Re: Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections

Posted: Mon Oct 29, 2018 7:59 am
by scarygary
After running the server for a few more weeks I started seeing this again. Even after changing max_connections to 1000 in my.cnf.

Zoneminder was upgraded to 1.32.2

my.cnf
max_connections = 1000

mysql> show status like '%onn%';
+-----------------------------------------------+---------------------+
| Variable_name | Value |
+-----------------------------------------------+---------------------+
| Aborted_connects | 123001 |
| Connection_errors_accept | 0 |
| Connection_errors_internal | 0 |
| Connection_errors_max_connections | 123232 |
| Connection_errors_peer_address | 0 |
| Connection_errors_select | 0 |
| Connection_errors_tcpwrap | 0 |
| Connections | 127805 |
| Locked_connects | 0 |
| Max_used_connections | 215 |
| Max_used_connections_time | 2018-10-28 08:17:47 |
| Performance_schema_session_connect_attrs_lost | 0 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 215 |
+-----------------------------------------------+---------------------+
16 rows in set (0.17 sec)

Re: Unable to connect to ZM db.SQLSTATE[HY000] [1040] Too many connections

Posted: Wed Apr 03, 2019 10:17 am
by MalakymR
knight-of-ni wrote: Sun Oct 14, 2018 12:40 pm The zoneminder navbar tells you how many connections there are currently and what your max is. You should keep an eye on that.
Whilst its good to see the status - what help is it to the user?

What can the user actually do (other than add _a lot_ of cameras) that would affect this?

I think this should be something that should be kept in-check internally?