Open jermlinden opened 1 year ago
Please provide:
Note: ProxySQL is designed to handle thousands (even a million) of client connections, not to handle a single client connection. If you use a single client connection you may experience behavior that are not typical of production environments.
docker.log proxysql.mitra.cnf.txt
Sorry for the delay. GH didn't like me uploading the config file as .cnf
Also note that I was making a new connection to proxysql each time, not reusing connections to it.
I see at least 2 serious misconfiguration, but not only.
You configured hostgroup 2 with 2 servers and different weight:
int.mysql57-indra-mitra-666.dev.secondlife.io
: weight 1000
int.mysql57-indra-mitra-1.dev.secondlife.io
: weight 1
I think this was an important information that wasn't mentioned. And it is not event matching in the config file...
So ProxySQL is configured:
int.mysql57-indra-mitra-666.dev.secondlife.io
Because proxysql is configured to desperately try to connect to int.mysql57-indra-mitra-666.dev.secondlife.io
, after 5 errors it stun the server and it stops trying.
Now, the other very important relevant misconfiguration:
You configured mysql-connect_timeout_server
to be 10000 milliseconds , that is 10 seconds.
I have a question here: what is your reason to configure mysql-connect_timeout_server
to such a high value?
To note, the default for mysql-connect_timeout_server
is 1000 : if proxysql isn't able to connect to the backend in a reasonable amount of time, something is wrong. 10 seconds is not a reasonable amount of time, it is a lot.
Now, the misconfiguration alone it is not enough. You also have some network issue that allows to reach the timeout. In fact, when you shutdown the instance, in ProxySQL error log you will see a series of:
Failed to mysql_real_connect() on 2:int.mysql57-indra-mitra-666.dev.secondlife.io:3306 ... 2013: Lost connection to MySQL server at 'handshake: reading initial communication packet', system error: 111.
But after that there are no more failed mysql_real_connect()
: the attempt to create a connection hang for long time , probably because AWS is blocking traffic to a not existing instance.
Thanks for taking a look René.
mysql-connect_timeout_server was copied from the old example config from when we first started using proxysql and hasn't been updated since. I'll look into updating it.
https://github.com/sysown/proxysql/commit/a8a7677c3d0cb78bda90af248ca48976664d73c6
The config file starts with 3 servers 0, 1, and 2.
On this instance of proxysql, which is not routing any live traffic, I deleted the -2 host and replaced it with a host I could kill without disrupting any live traffic like:
UPDATE mysql_servers SET hostname='int.mysql57-indra-mitra-666.dev.secondlife.io' WHERE hostname='int.mysql57-indra-mitra-2.dev.secondlife.io' AND hostgroup_id=2; LOAD MYSQL SERVERS TO RUNTIME;
Queries are still occasionally being routed to a backend mysql server after it dies a rough & tumble death and proxysql marks it a SHUNNED
ProxySQL version 2.4.8-2 OS version: Debian 10.13
How I reproduced:
aws ec2 stop-instances
)almost all of the queries will go to the host that is still up, but occasionally a query will slip through to the shunned host and then fail