Bug #47347 ro-pooling.lua + one read-only backend down + event-thread>1 = high CPU (80%)
Submitted: 16 Sep 5:11 Modified: 16 Sep 5:20
Reporter: Diego Medina
Status: Verified
Category:Proxy: Core Severity:S2 (Serious)
Version:0.8.0 OS:Any
Assigned to: Jan Kneschke Target Version:

[16 Sep 5:11] Diego Medina
Description:
Using the ro-pooling.lua lua script, at least  --event-threads=2 and you have one
proxy-read-only-backend-addresses pointing to a server that is down. Start several
connections through the proxy, after about 14 connections / disconnections, the proxy
will get stuck with high CPU usage.

How to repeat:
The least items I had to have are these:

1- Start the proxy like this:

$ ./sbin/mysql-proxy --event-threads=2  --proxy-backend-addresses=127.0.0.1:5132 
--proxy-read-only-backend-addresses=127.0.0.1:5131 
--proxy-lua-script=./share/doc/mysql-proxy/ro-pooling.lua 

127.0.0.1:5131 does not exists (server down)
2- On another terminal, run this:

$ while [ true ] ; 
   do ./sandboxes/msb_5_1_32/use -P4040 -e "exit";
   let x++ ; echo $x;
   sleep 0.1;
done ;

3- After about run 14-20, the proxy process will start using about 80-90% of the CPU. You
can stop the shell script at this point, and the proxy will just sit there, using all that
CPU
[18 Sep 16:39] Enterprise Tools JIRA Robot
Diego Medina writes: 
ro-pooling.lua file attached
[18 Sep 16:41] Enterprise Tools JIRA Robot
Diego Medina writes: 
shell script attached.
[21 Sep 17:35] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
Moved to 0.8.1 to get 0.8.0 out with this known bug.