Slow Query Log Rotation and Expiration

Note

This feature is currently considered BETA quality.

Percona has implemented two new variables, max_slowlog_size and max_slowlog_files to provide users with ability to control the slow query log disk usage. These variables have the same behavior as upstream variable max_binlog_size and max_binlog_files variable used for controlling the binary log.

Warning

For this feature to work variable slow_query_log_file needs to be set up manually and without the .log sufix. The slow query log files will be named using slow_query_log_file as a stem, to which a dot and a sequence number will be appended.

Version Specific Information

System Variables

variable max_slowlog_size
Version Info:
Command Line:

Yes

Config File:

Yes

Scope:

Global

Dynamic:

Yes

Variable Type:

numeric

Default Value:

0 (unlimited)

Range:

4096 - 1073741824

Slow query log will be rotated automatically when its size exceeds this value. The default is 0, don’t limit the size. When this feature is enabled slow query log file will be renamed to slow_query_log_file.000001.

variable max_slowlog_files
Version Info:
Command Line:

Yes

Config File:

Yes

Scope:

Global

Dynamic:

Yes

Variable Type:

numeric

Default Value:

0 (unlimited)

Range:

0 - 102400

Maximum number of slow query log files. Used with max_slowlog_size this can be used to limit the total amount of slow query log files. When this number is reached server will create a new slow query log file with increased sequence number. Log file with the lowest sequence number will be deleted.

Percona Server
Call Us
+1-888-316-9775 (USA - Sales)
+1-208-473-2904 (USA - Sales)
+44-208-133-0309 (UK - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-877-862-4316 (Emergency)
+1-855-55TRAIN (Training)
+1-925-271-5054 (Training)

Table Of Contents

Previous topic

Ability to change database for mysqlbinlog

Next topic

Crash-Resistant Replication

This Page



© Copyright Percona LLC and/or its affiliates 2009-2014.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
Created using Sphinx 1.1.3.
This documentation is developed in Launchpad as part of the Percona Server source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.
]]>