MySQL Proxy memory consumption in threaded mode
Posted by:
Rubi Dagan
Date: October 13, 2010 05:10AM
Hi,
I've been checking the proxy in threaded mode, and it appears as if it consumes a significantly larger amount of memory in threaded mode.
I've run 2 proxy instances, the first standard (mysql-proxy.conf) and the second in threaded mode (mysql-proxy.threaded.conf).
As you can see bellow, the threaded mode consumes significantly more memory (x3 to x8 consumption, depends on the amount of threads).
Besides that and the port number, all the configuration settings are identical.
Is it a standard and known behavior?
Below you can see the process output and the configuration I've been using.
Thanks,
Rubi Dagan
[root@myserver bin]# ps -eo pid,tid,ni,pri,psr,pcpu,size,wchan:14,comm,args -L | grep proxy
14534 14534 0 23 0 1.3 9816 - mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.conf
25457 25457 0 24 0 0.0 74172 epoll_wait mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.threaded.conf
25457 25458 0 24 0 0.0 74172 epoll_wait mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.threaded.conf
[root@myserver bin]# ps -eo pid,tid,ni,pri,psr,pcpu,size,wchan:14,comm,args -L | grep proxy
14534 14534 0 23 0 1.3 9816 epoll_wait mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.conf
25700 25700 0 23 0 0.0 25032 epoll_wait mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.threaded.conf
25700 25701 0 23 0 0.0 25032 epoll_wait mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.threaded.conf
25700 25702 0 23 0 0.0 25032 epoll_wait mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.threaded.conf
25700 25703 0 23 1 0.0 25032 epoll_wait mysql-proxy /usr/local/mysql-proxy/libexec/mysql-proxy --defaults-file=/etc/mysql-proxy.threaded.conf
[mysql-proxy]
#########################
# admin module
#########################
admin-lua-script=/usr/local/mysql-proxy/lib/mysql-proxy/lua/admin.lua
admin-address = :secret
admin-username=secret
admin-password=secret
#########################
# application options
#########################
daemon = true
log-file = /usr/local/mysql-proxy/2mysql-proxy.log
pid-file=/usr/local/mysql-proxy/2mysql-proxy.pid
log-level = error
#log-level = debug
#########################
# proxy-module
#########################
proxy-address = :secret
proxy-backend-addresses = secret:secret
proxy-read-only-backend-addresses = secret:secret
proxy-lua-script = /usr/local/mysql-proxy/lib/mysql-proxy/lua/ro-balance.lua
event-threads = 4