0

Has anyone experienced an issue where when the slow log is enabled with the following options:

root@(none)> show global variables like "%slow_query%";
+-----------------------------------+-------------------------------+
| Variable_name                     | Value                         |
+-----------------------------------+-------------------------------+
| slow_query_log                    | ON                            |
| slow_query_log_always_write_time  | 10.000000                     |
| slow_query_log_file               | /var/log/mysql/mysql-slow.log |
| slow_query_log_use_global_control |                               |
+-----------------------------------+-------------------------------+
4 rows in set (0.00 sec)

I get a weird issue where the slow log file is being spammed with the same thing over and over again, without a single slow log query:

Time                 Id Command    Argument
/usr/sbin/mysqld, Version: 8.0.25-15 (Percona Server (GPL), Release '15', Revision 'a558ec2'). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock

These three lines are being spammed constantly, about 100 kilobytes per second. Not only that, because of this the replication was lagging, the seconds behind master was constantly creeping up. I was noticing some odd usage of the OS disks (the MySQL datadir is on a different array) where the /var/log/mysql directory resides, I suppose it was flushing to disk each and every one of these useless messages. Once I disabled slow_query_log the SBM started dropping very fast and has no problems keeping up.

Am I hitting a bug with Percona MySQL, I can't find any reference anywhere of this?

Vladimir
  • 321
  • 1
  • 12
  • Consider slow_query_log_always_write_time = 300 to get a reminder in the slow query log every 5 minutes rather than after just 10 seconds. – Wilson Hauck Aug 31 '23 at 16:05

1 Answers1

0

Consider adding to my.cnf or my.ini the following

min_examined_row_limit=1 

to avoid useless chatter in the Slow Query Log.

Wilson Hauck
  • 472
  • 5
  • 11
  • This makes no difference, as I think this is a bug in Percona mysql itself. It keeps spamming the same three lines without any queries many many times a second, like I pasted in the question. I'll try upgrading the Percona version of MySQL. – Vladimir Sep 01 '23 at 07:08
  • Additional DB information request, please. OS, Version? RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post TEXT data on justpaste.it and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*), sum(data_length), sum(index_length), sum(data_free) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; for server workload tuning analysis to provide suggestions. – Wilson Hauck Sep 01 '23 at 15:25
  • Please also post TEXT results of first page of TOP from your OS Command Prompt for analysis. – Wilson Hauck Sep 01 '23 at 16:36