-->

2013-07-29

memo: mysql-proxy

*** glibc detected *** /usr/bin/mysql-proxy: corrupted double-linked list: 0x00000000023727e0 ***

$ tail -n10000 /var/log/mysql/mysql-proxy.log | perl -pe 's/^\S+ \S+:/:/' | perl -pe 's/ PID=\d+ died on signal=\d+ \(it used \d+ kBytes max\)/ PID=xxx died on signal=xxx (it used xxx kBytes max)/' | perl -pe 's/ Epoll ADD\(1\) on fd \d+ failed\./ Epoll ADD(1) on fd xxx failed./' | sort | uniq -c | sort -k1n
      2 : (critical) chassis-mainloop.c:267: applying config of plugin proxy failed
      2 : (critical) mysql-proxy-cli.c:595: Failure from chassis_mainloop. Shutting down.
      2 : (critical) network-socket.c:401: bind(127.0.0.1:4040) failed: Address already in use (98)
      2 : (warning) (libevent) Epoll ADD(1) on fd xxx failed.  Old events were 0; read change was 1 (add); write change was 0 (none): Bad file descriptor
     12 : (critical) chassis-unix-daemon.c:189: [angel] PID=xxx died on signal=xxx (it used xxx kBytes max) ... waiting 3min before restart
     18 : (critical) last message repeated 1 times
    295 : (warning) last message repeated 101 times
    302 : (warning) (libevent) event_del: event has no event_base set.
   4682 : (critical) proxy-plugin.c.1127: I have no server backend, closing connection
   4683 : (critical) network-mysqld.c.1414: plugin_call(CON_STATE_READ_QUERY) failed

$ /usr/bin/sudo /usr/bin/rcsdiff /etc/config-archive/etc/mysql/mysql-proxy.cnf,v /etc/mysql/mysql-proxy.cnf
===================================================================
RCS file: /etc/config-archive/etc/mysql/mysql-proxy.cnf,v
retrieving revision 1.3
diff -r1.3 /etc/mysql/mysql-proxy.cnf
8c8
< event-threads = 3
---
> event-threads = 1
16c16
< max-open-files = 8192
---
> max-open-files = 2048

$ ps aux|grep mysql-p|grep -v "[g]rep"
root     29174  0.0  0.0  35952   512 ?        S    06:34   0:00 /usr/bin/mysql-proxy --daemon --pid-file=/var/run/mysql-proxy.pid --defaults-file=/etc/mysql/mysql-proxy.cnf
root     29175 25.3  0.0  38688  4368 ?        S    06:34   1:15 /usr/bin/mysql-proxy --daemon --pid-file=/var/run/mysql-proxy.pid --defaults-file=/etc/mysql/mysql-proxy.cnf

$ pstree -p |grep mysql-p
        |-mysql-proxy(29174)---mysql-proxy(29175)

$ sudo grep proxy-lua-script /etc/mysql/mysql-proxy.cnf
proxy-lua-script = /etc/mysql/tutorial-keepalive.lua

$ bunzip2 -c /usr/share/doc/mysql-proxy-0.8.2/examples/tutorial-keepalive.lua.bz2 > tutorial-keepalive.lua.orig

$ diff tutorial-keepalive.lua.orig /etc/mysql/tutorial-keepalive.lua
37,38c37,38
< local min_idle_connections = 4
< local max_idle_connections = 8
---
> local min_idle_connections = 16
> local max_idle_connections = 80
41c41
< local is_debug = true
---
> local is_debug = false

http://dev.mysql.com/doc/refman/5.0/en/mysql-proxy-configuration.html#option_mysql-proxy_keepalive
MALLOC_CHECK_
http://www.flateight.com/modules/popnupblog/index.php?postid=1633
http://ruby-gnome2.sourceforge.jp/ja/hiki.cgihttp:/sfmltoj.cgi?key=/mailarchive/message.php%3Fmsg_id%3D8110724
http://www.ipa.go.jp/security/awareness/vendor/programmingv2/contents/c904.html

$ rcsdiff /etc/config-archive/etc/conf.d/mysql-proxy,v /etc/conf.d/mysql-proxy
===================================================================
RCS file: /etc/config-archive/etc/conf.d/mysql-proxy,v
retrieving revision 1.1
diff -r1.1 /etc/conf.d/mysql-proxy
12a13,14
>
> MALLOC_CHECK_=3

0 件のコメント: