MySQL slow query log logging all queries

Posted by Blanka on Server Fault See other posts from Server Fault or by Blanka
Published on 2012-08-30T20:01:15Z Indexed on 2012/08/30 21:40 UTC
Read the original article Hit count: 231

Filed under:
|
|
|
|

We have a MySQL 5.1.52 Percona Server 11.6 instance that suddenly started logging every single query to the slow query log. The long_query_time configuration is set to 1, yet, suddenly we're seeing every single query (e.g. just saw one that took 0.000563s!). As a result, our log files are growing at an insane pace. We just had to truncate a 180G slow query log file.

I tried setting the long_query_time variable to a really large number to see if it stopped altogether (1000000), but same result.

show global variables like 'general_log%';
+------------------+--------------------------+
| Variable_name    | Value                    |
+------------------+--------------------------+
| general_log      | OFF                      |
| general_log_file | /usr2/mysql/data/db4.log |
+------------------+--------------------------+
2 rows in set (0.00 sec)

show global variables like 'slow_query_log%';
+---------------------------------------+-------------------------------+
| Variable_name                         | Value                         |
+---------------------------------------+-------------------------------+
| slow_query_log                        | ON                            |
| slow_query_log_file                   | /usr2/mysql/data/db4-slow.log |
| slow_query_log_microseconds_timestamp | OFF                           |
+---------------------------------------+-------------------------------+
3 rows in set (0.00 sec)

show global variables like 'long%';
+-----------------+----------+
| Variable_name   | Value    |
+-----------------+----------+
| long_query_time | 1.000000 |
+-----------------+----------+
1 row in set (0.00 sec)

© Server Fault or respective owner

Related posts about mysql

Related posts about configuration