June 19, 2013

Post: Fun with the MySQL pager command

… hundreds of connections and you want to know how many connections are sleeping, …sleeping connections can be done with: mysql> SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND=’Sleep‘; +———-+ | COUNT(*) | +———-+ | 320 | +———-+ and counting the number of connection

Post: Debugging sleeping connections with MySQL

… it has couple of memcached connections. Few MySQL connections (to the same host, which if usually bad idea) and connection to some external web… with the process are not only helpful to debug sleeping connections with MySQL but many other cases when you see web application locking up…

Post: Troubleshooting MySQL Memory Usage

…>> ps.log sleep 60 done Check for Table Cache Related Allocations There are cases when MySQL will…per connection) are all connection buffers and so if you close connection MySQL can clean them up. Killing connections … There is no comparable variables of how many user variables are allocated (and how …

Post: How to debug long-running transactions in MySQL

…out if the disk has less than this many MB free. MB_THRESHOLD=100 # Make sure…s`-tcpdump & mysql -e ‘show innodb status\Gshow full processlist’ > /root/tcpdumps/`date +%s`-innodbstatus pid=$! sleep 30 kill… your server to find idle-in-transaction connections that are just sitting there doing nothing,…

Post: Impact of the number of idle connections in MySQL

…. I recently had to work with many customers having large number of connections opened in MySQL and although I told them this was… idle connections” php ./make_conn.php $numconn & cat dbt2.sql | mysql -h 10.2.2.129 -u root dbt2 sleep 120 ./run_mysql.sh… idle connections” php ./make_conn.php $numconn & cat dbt2.sql | mysql -h 10.2.2.129 -u root dbt2 sleep 120 ./run_mysql.sh…

Comment: Debugging sleeping connections with MySQL

… dbconnect() fails for mysql_errno() reason 1040 (too many connections). If it does i run shell_exec(“httpd restart”) and the sleeping connections are gone.

Post: SHOW INNODB STATUS walk through

… locked rows – there are normally many rows for each lock structure. For each of connections for MySQL there will be ether not started state if there is no active Innodb transaction for this connection, or ACTIVE if transaction is active. Note transaction can be active even if connection is in “Sleep” stage – if…

Comment: Why do you need many apache children ?

many mysql connections in sleep state for so long time(wait_timeout). Original timeout was set to default (300 seconds). Some terribly slow http connection… be ok. Mysql connections in sleep state only are available for short duration and there are no aboted_clients in mysql error log. Opening…

Comment: MySQL for Hosting Providers - how do they manage ?

…same connection ID. Kill that connection….Query | 3 | init | select sleep(10) | +—–+——+———–+——+———+——+——-+———————–+ mysql> show full processlist; +—–+——+———–+——+———+——+——-+———————–+ | … in many cases. Shared …