MySQL Server has gone away pt-query-digest

I have a slow log which always ends with this.

slow.log: 99% 00:15 remain

It then spits out this error and repeats it until the process is stopped.

Pipeline process 4 (iteration) caused an error: DBD::mysql::st execute failed: MySQL server has gone away [for Statement “SELECT first_seen, last_seen, reviewed_by, reviewed_on, comments, CONV(checksum, 10, 16) AS checksum_conv FROM slow_query_log.query_review WHERE checksum=CONV(?, 16, 10)” with ParamValues: 0=‘D8703A6195E126FD’] at /usr/local/bin/pt-query-digest line 8672.

PT
pt-query-digest --user=$user --password=$password --review S=$socket,D=slow_query_log,t=query_review --review-history S=$socket,D=slow_query_log,t=query_review_history --no-report --limit=0% --filter=" $event->{Bytes} = length($event->{arg}) and $event->{hostname}="$HOSTNAME"" $1

$ rpm -q perl-DBD-MySQL
perl-DBD-MySQL-3.0007-2.el5

Slow Log Info

Percona Server 5.1.60

du -hs slow.log
72G slow.log

percona-toolkit-2.1.1

This is a bug, I just reported about it here [URL]https://bugs.launchpad.net/percona-toolkit/+bug/1018258[/URL]

How long has ptqd been running before it bombs out? You can try increasing wait_timeout, by default ptwd sets it to 10000 i.e. --set-vars wait_timeout=28800

revin wrote on Tue, 26 June 2012 22:55

I agree. Whenever I’ve seen the “MySQL server has gone away” error message, MySQL server really hasn’t gone away - but the connection has timed out.

The connection wait_timeout variable can be set ‘on the fly’ by issuing:

mysql> set global wait_timeout=<numeric_value>

at the MySQL command line client.

If you do this, be sure to add it to your /etc/my.cnf file so that the configuration survives any restart of MySQL.

I hope this helps.

/David C.