Re: Proxy pool member. How to...?
At first I tried load balancing without a script (better say using script to only print out proxy.connection.backend_ndx in connect_server() function). Result: the first server out of five was executing queries. By reading previous post about 1ms connection time now I understand why round robin wasn't happening in this case.
Tried script from (http://dev.mysql.com/doc/refman/5.0/en/mysql-proxy-scripting-connect-server.html).
Result: Error --> (connect_server) /opt/dba/mysql-proxy/share/connect.lua:4: attempt to index field 'connection' (a userdata value). Wondering what is happening there.
Tried own improvised load balancing script with 6 servers behind proxy:
--------------------------------------------------
-- m.lua
function connect_server()
print ("~~> " .. proxy.connection.backend_ndx)
id = (math.random(1,10000) % 6) + 1
proxy.connection.backend_ndx = id
print ("~~> " .. proxy.connection.backend_ndx)
print("Choosing backend" .. id)
print("Using " .. proxy.servers[id].address)
end
------------------------------------------------------
Randomization works perfectly. However, proxy.connection.backend_ndx = id fails again. I guess there is a deeper issue with it.
Subject
Views
Written By
Posted
7308
September 10, 2007 05:08PM
3203
September 10, 2007 11:52PM
3550
September 11, 2007 12:58AM
3386
September 11, 2007 01:35AM
Re: Proxy pool member. How to...?
3420
September 11, 2007 02:37AM
3183
September 11, 2007 03:38PM
3026
September 12, 2007 03:42PM
3085
September 12, 2007 05:03PM
3018
September 13, 2007 01:45AM
3240
September 13, 2007 03:16PM
3078
September 13, 2007 03: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.