Hello,
I’ve been using the guide to test the PXC Operator on a local Kubernetes installation.
I’ve been resolving application compatibility issues, but have hit a barrier. My MySQL server logs are now saying the following:
[HTML]
% kubectl logs cluster1-pxc-0 | tail -n 5
2019-11-04T17:08:16.015741Z 0 [Warning] Too many connections
2019-11-04T17:08:18.004719Z 0 [Warning] Too many connections
2019-11-04T17:08:18.004817Z 0 [Warning] Too many connections
2019-11-04T17:08:18.005107Z 0 [Warning] Too many connections
2019-11-04T17:08:18.005212Z 0 [Warning] Too many connections
[/HTML]
Connecting directly to the container, I can see that the max_connections setting hasn’t been set, meaning each server should alow the default of 151 connections.
[HTML]
% kubectl exec -it cluster1-pxc-0 /bin/bash
bash-4.2$ mysql -uroot -proot_password
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1040 (HY000): Too many connections
bash-4.2$ grep -r max_connections /etc/my.cnf /etc/my.cnf.d /etc/mysql
bash-4.2$ echo $?
1
[/HTML]
Asking ProxySQL what it thinks about the connections:
[HTML]
mysql> select * from mysql_servers;
±-------------±------------±-----±----------±-------±-------±------------±----------------±--------------------±--------±---------------±--------+
| hostgroup_id | hostname | port | gtid_port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
±-------------±------------±-----±----------±-------±-------±------------±----------------±--------------------±--------±---------------±--------+
| 11 | 10.244.3.27 | 3306 | 0 | ONLINE | 1000 | 0 | 1000 | 0 | 1 | 0 | |
| 10 | 10.244.3.27 | 3306 | 0 | ONLINE | 1000 | 0 | 1000 | 0 | 1 | 0 | |
±-------------±------------±-----±----------±-------±-------±------------±----------------±--------------------±--------±---------------±--------+
2 rows in set (0.01 sec)
[/HTML]
(I have a single host, with allow_unsafe_configuration: true)
Due to the connection limit being reached, the health check correctly kills my pxc container. As soon as it comes back up, though, it seems that ProxySQL tries to re-open all of its connections. This means my server is essentially dead.
Is this max_connections=1000 above a misconfiguration by the operator, or have I missed something?