MySQL Forums
Forum List  »  Router & Proxy

Re: some problems in connection pool with mysql-proxy
Posted by: Zhang Guangpei
Date: September 16, 2010 08:35PM

I add some info now:

enviorment:
----------------
mysql-proxy -V
mysql-proxy 0.8.1
chassis: mysql-proxy 0.8.1
glib2: 2.24.0
libevent: 1.4.14b-stable
LUA: Lua 5.1.4
package.path: /usr/local/lib/mysql-proxy/lua/?.lua
package.cpath: /usr/local/lib/mysql-proxy/lua/?.so
-- modules
admin: 0.8.1
proxy: 0.8.1


Run Command at 192.168.0.1:mysql-proxy --daemon --admin-address=:4401
--proxy-address=:4040 --log-level=debug --proxy-backend-addresses=192.168.0.2:3306
--proxy-read-only-backend-addresses=192.168.0.3:3306
--proxy-read-only-backend-addresses=192.168.0.4:3306 --admin-username=root
--admin-password=abc789 --admin-lua-script=/usr/local/lib/mysql-proxy/lua/admin.lua
--proxy-lua-script=/home/zhanggp/mysql-proxy-0.8.1/examples/tutorial-keepalive.lua

I test like this :
at the client:
[rhel542]:/home/zhanggp#mysql -uroot -pabc789 -P4040 -h192.168.0.1 -D test -e "use
test"
[rhel542]:/home/zhanggp#mysql -uroot -pabc789 -P4040 -h192.168.0.1 -D test -e "use test"
[rhel542]:/home/zhanggp#mysql -uroot -pabc789 -P4040 -h192.168.0.1 -D test -e "use test"
[rhel542]:/home/zhanggp#mysql -uroot -pabc789 -P4040 -h192.168.0.1 -D test -e "use test"
[rhel542]:/home/zhanggp#
[rhel542]:/home/zhanggp#mysql -uroot -pabc789 -P4040 -h192.168.0.1 -D test -e "use test"
ERROR 1047 (08S01): Unknown command

then the debug info at the proxy :
[connect_server]
[1].connected_clients = 0
[1].idling_connections = 0
[1].type = 1
[1].state = 0
[1] open new connection
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[disconnect_client]
2010-09-17 10:15:29: (debug) abs wait-for-event::done usec= 0
2010-09-17 10:15:29: (debug) abs lua-exec::done usec= 0

[connect_server]
[1].connected_clients = 0
[1].idling_connections = 1
[1].type = 1
[1].state = 1
[2].connected_clients = 0
[2].idling_connections = 0
[2].type = 2
[2].state = 0
[2] open new connection
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[disconnect_client]
2010-09-17 10:15:30: (debug) abs wait-for-event::done usec= 0
2010-09-17 10:15:30: (debug) abs lua-exec::done usec= 0

[connect_server]
[1].connected_clients = 0
[1].idling_connections = 1
[1].type = 1
[1].state = 1
[2].connected_clients = 0
[2].idling_connections = 1
[2].type = 2
[2].state = 1
[3].connected_clients = 0
[3].idling_connections = 0
[3].type = 2
[3].state = 0
[3] open new connection
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[disconnect_client]
2010-09-17 10:15:31: (debug) abs wait-for-event::done usec= 0
2010-09-17 10:15:31: (debug) abs lua-exec::done usec= 0

[connect_server]
[1].connected_clients = 0
[1].idling_connections = 1
[1].type = 1
[1].state = 1
[2].connected_clients = 0
[2].idling_connections = 1
[2].type = 2
[2].state = 1
[3].connected_clients = 0
[3].idling_connections = 1
[3].type = 2
[3].state = 1
opening new connection on: 1
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[read_query]
authed backend = 0
used db = test
[disconnect_client]
2010-09-17 10:15:39: (debug) abs wait-for-event::done usec= 0
2010-09-17 10:15:39: (debug) abs lua-exec::done usec= 0

[connect_server]
[1].connected_clients = 0
[1].idling_connections = 2
[1].type = 1
[1].state = 1
[2].connected_clients = 0
[2].idling_connections = 1
[2].type = 2
[2].state = 1
[3].connected_clients = 0
[3].idling_connections = 1
[3].type = 2
[3].state = 1
using pooled connection from: 1
2010-09-17 10:15:51: (debug) [network-mysqld.c:937]: error on a connection (fd: -1 event:
0). closing client connection.
[disconnect_client]

please help me solve the problem,thanks very much!


===============thanks ,every one ,I have resolved the problem
modify the /etc/my.cnf
as:
old_passwords=0

and then enter mysql:SET PASSWORD FOR 'root'@'192.168.0.1' = PASSWORD('abc789');

but I want to ask another question:
when the clients sends many connections such as 1000 at the same
time,but I just have 100 connections in the pool.

if there are no idle connection in the pool,Can I use mysql-proxy to
make the connection wait,not open new connection ?



Edited 1 time(s). Last edit at 09/17/2010 03:32AM by Zhang Guangpei.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: some problems in connection pool with mysql-proxy
4439
September 16, 2010 08:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.