ruby on rails 3 - How to tell if reads are being redirect to MySQL slave on Rails3 -


[update] may use (or misuse) of seamless_database_pool gem.

i setup master/slave setup on rails3 using seamless_database_pool. mean reads not being redirected slave?

how can check @ mysql level? hoping show processlist this, i'm not seeing processes.

[update]

running show processlist on master displays queries being run, guess reads not being passed slave.

the bin_log file has following (9's , x's added):

/*!40019 set @@session.max_insert_delayed_threads=0*/; /*!50003 set @old_completion_type=@@completion_type,completion_type=0*/; delimiter /*!*/; \# @ 4 \#xxxxxxx 99:99:99 server id 2 end_log_pos 106 start: binlog v 4, server v 5.1.52-log created xxxx 99:99:99 @ startup rollback/*!*/; binlog ' xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx '/*!*/; \# @ 106 \#xxxx 99:99:99 server id 2 end_log_pos 125 stop delimiter ; \# end of log file rollback /* added mysqlbinlog */; /*!50003 set completion_type=@old_completion_type*/;

thanks

it possible processes quick catch on "show processlist". if case, might able turn on logging in my.cnf.

otherwise, understand slave mysql recommended have binary logging turned on, , can inspect "mysqlbinlog" utility.

you go directory mysql binlogs stored (on linux it's /var/lib/mysql or /var/lib/mysql/data), check various bin files latest - thisisyourbinfile.001723 - , run mysqlbinlog on it. output pretty messy, can parsed sed or searched grep.

there utilities intercept mysql packets @ network level, , display them on standard output. based on tcpdump, , need little more tcpdump itself: e.g. http://www.megalinux.net/using-tcpdump-for-mysql-query-logging/


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -