Have been monitoring mysql server for year, I notice the mysql database max_used_connections cannot get pass 4832. Once hitting 4832, MySQL begins to show slowness, while the loads/cpu usage/memory are under moderate usage. The max_connections is set to 6000 (SHOW VARIABLES LIKE "max_connections"). Running Ubuntu 20.04, Mysql5.7.33 Below are configuration I modified:
mysql.conf
max_connections = 6000 # have tried other values like 10000
open_files_limit = 1048576
Modifying /etc/systemd/system/mysql.service
LimitNOFILE=infinity
LimitMEMLOCK=infinity
/etc/security/limits.conf
* soft nofile 1048576
* hard nofile 1048576
* soft nproc 1084576
mysql soft nproc 1084576
mysql hard nproc 1084576
mysql soft nofile 1084576
mysql hard nofile 1084576
Ulimit
ulimit -n; // 1048576
ulimit -u; // 257436
Previously the server is 12 core 48GB memory, hitting 4832. I upgraded to 16 core 64GB memory, max_used_connections still hitting 4832 max. It is always hitting 4832 and no further. Any ideas?
mysql.conf
is this the exact filename,my{sql}.cnf
is usually the extension used. Can you share ashow global status
when the limit is reached. Does the slowdown occur regardless of what the connections are doing (e.g.select sleep(600)
)?