[Sqlrelay-discussion] Mysql auto reconnect problem
Brought to you by:
mused
|
From: lee a. <an...@gm...> - 2012-12-04 04:25:10
|
Dear all:
We are using sqlrelay for php connection pool.
There are some problem about mysql's MYSQL_OPT_RECONNECT.
When sqlrelay's conneciotn exceed Mysql's interactive_timeout,or Mysql
server daemon restarted.
We will always get Error "Lost connection to MySQL server during query"
unless we restart sqlrelay.
Env infomantion:
OS:centos6.2
Sqlrelay:0.47
Mysql lib:5.1.59
Test plan as below.
1.Start sqlrelay -> Mysql connection,sqlrelay,conf as below
=========================================
sqlrealy
<instances>
<instance id="test_mysql"
dbase="mysql"
addresses=""
port=""
socket="/opt/sqlrelay/socket/test_mysql.socket"
connections="1"
maxconnections="20"
maxqueuelength="0"
cursors="1"
maxcursors="100"
maxlisteners="20"
listenertimeout="1"
waitfordowndatabase="no"
runasuser="nobody"
runasgroup="nobody"
authtier="connection"
handoff="pass"
endofsession="rollback"
ignoreselectdatabase="yes"
timequeriessec="-1"
timequeriesusec="-1"
debug="none">
<users><user user="user" password="password"/></users>
<connections>
<connection connectionid="test_mysql"
string="user=test_mysql;password=test_mysql;host=172.16.30.211;port=3307;db=test_mysql;fakebinds=yes">
</connections>
</instance>
</instances>
=========================================
2.Useing sqlrsh test connection,work functionally.
=========================================
# sqlrsh -id test_mysql
SQLRShell - Version 0.22
Connected to: localhost:0 as user
type help; for a help.
0> select now();
now()
===================
2012-12-03 14:21:50
Rows Returned : 1
Fields Returned : 1
System time : 50000
=========================================
3.Then,kill client process from mysql server.(Here we using kill process to
emulate Mysql's interactive_timeout )
We got "Lost connection to MySQL server during query" log.
=========================================
sqlrsh -id test_mysql
SQLRShell - Version 0.22
Connected to: localhost:0 as user
type help; for a help.
0> select now();
2013:
Lost connection to MySQL server during query
Rows Returned : 0
Fields Returned : 0
System time : 60000
0>
=========================================
This connection wont work unless we restart sqlrelay.
We have checked sqlrelay's ChangeLog,MYSQL_OPT_RECONNECT have been applied
after sqlrelay-0.40.
Any suugestion or advice will be appreciated!!
|