MySQL Forums
Forum List  »  Performance

MySql 5.7 - Poor Performance PURGE BINARY LOGS
Posted by: Davy Campano
Date: March 23, 2016 08:08PM

I just completed an upgrade from MySql 5.6.22 to MySql 5.7.11. Since upgrading we are experiencing very poor performance when purging binary logs. Our server is configured with expire_logs_days to 4, max_binlog_size to 1073741824 (1GB). A query to SHOW BINARY LOGS shows that we have 72 binary log files. If I do a PURGE BINARY LOGS TO 'file.00001' and only remove the earliest file the query takes approximately 60 seconds to complete. The same query on 5.6.22 was almost instant (0.02 seconds). I enabled profiling and ran the statement and the results are below. This is without any other queries being performed on this server.

mysql> show profile;
+--------------------+-----------+
| Status | Duration |
+--------------------+-----------+
| starting | 61.612292 |
| query end | 0.000010 |
| closing tables | 0.000004 |
| freeing items | 0.000022 |
| logging slow query | 0.000002 |
| logging slow query | 0.000056 |
| cleaning up | 0.000015 |
+--------------------+-----------+

I am trying to debug what could be causing this but not having much luck. An iostat while running the purge appears that the whole 1GB binary log file is being read. Anyone have suggestions on how to do further tracing to determine the cause of this?

Options: ReplyQuote


Subject
Views
Written By
Posted
MySql 5.7 - Poor Performance PURGE BINARY LOGS
2446
March 23, 2016 08:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.