Recently, we installed mysql-proxy as our database proxy which backend servers are running as master-slave.

And also we using the lua script to make mysql-proxy working as failover of backends.

function connect_server()
local s =[1]
-- local s =[2]

if s.state ~= proxy.BACKEND_STATE_DOWN then
proxy.connection.backend_ndx = 1
-- proxy.connection.backend_ndx = 2
-- os.execute("/bin/mail -s 't66 mysqld is dow' <<<'mysqld is down'")
proxy.connection.backend_ndx = 2
-- proxy.connection.backend_ndx = 1

But we met a significant problem of mysql-proxy performance is bad.

So my problem is how to analyze mysql-proxy performance and how to tune it?

Ma Hao