MySQL Forums
Forum List  »  Router & Proxy

Under what conditions destination backend is changed?
Posted by: Vladimir Linevich
Date: March 26, 2013 10:38PM

I'm using mysql-proxy-0.8.2-1 for load balancing purposes.
I've failed to get an answer from documentation,
it's' not obvious, under what conditions destination backend is changed to a next one in upstream.

I was looking into 'balance.lua', but it seems that balancing mechanism does not use this script -
it keeps working even when i move '/usr/lib64/mysql-proxy/lua/proxy/balance.lua' to a different dir (and restart proxy).

My configuration looks like this
--daemon --log-file=/var/log/mysql/proxy.log --log-level=debug
--user=nginx \
--proxy-address=172.16.3.103:3306
--proxy-backend-addresses=172.16.3.104:3306
--proxy-backend-addresses=172.16.3.105:3306

#Adding\removing the next line gives no effect:
--proxy-lua-script=/usr/lib64/mysql-proxy/lua/proxy/balance.lua

I'm querying proxy host from two boxes with this command line:
while (:); do mysql -uvm1 -ppass -e "select id,created from mydb.goods where id = FLOOR(7 + (RAND() * 5))" --port 3306 --host 172.16.3.103; done;

If this loop is started on one machine, most queries are accepted by the first backend (172.16.3.104), and a very tiny part goes to the second one (172.16.3.105).
When i start the 'while' loop on another client system, queries are separated 50\50 between mysql backends.

This situation repeats with and without including 'balance.lua' script.

Please explain, what global variables on mysql backend are being checked when decision about the backend is made.

Best Regards.



Edited 1 time(s). Last edit at 03/27/2013 08:28AM by Vladimir Linevich.

Options: ReplyQuote


Subject
Views
Written By
Posted
Under what conditions destination backend is changed?
4988
March 26, 2013 10:38PM


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.