Can expire_logs_days be less than 1 day in MySQL?
Posted
by
Scott
on Server Fault
See other posts from Server Fault
or by Scott
Published on 2010-09-08T12:47:16Z
Indexed on
2011/01/17
23:54 UTC
Read the original article
Hit count: 224
mysql
|mysql-replication
So... yesterday I received an "after the fact email" about a campaign that has started for one of the services that I run. Now the DB server is getting hammered, hard, to the tune of about 300mb/min in binary logging for the replicate. As you could imagine, this is chewing up space at a fairly tremendous rate.
My normal 7 day expiry of binary logs just isn't cutting it. I've resorted to truncating logs to just the last for 4 hours with(I'm verifying that replication is up to date with mk-heartbeat
):
PURGE MASTER LOGS BEFORE DATE_SUB( NOW(), INTERVAL 4 HOUR);
I'm just running that from cron every few hours to weather the storm, but it made me question the minimum value for expire_logs_days
. I haven't come across a value that is less than 1, but that doesn't mean that it isn't possible. http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_expire_logs_days gives the type as being numeric, but doesn't indicate if it's expecting integers.
© Server Fault or respective owner