Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following settings in my /etc/my.cnf

log-bin                 = /var/lib/mysql_bin_logs/mysql-bin.log
expire_logs_days        = 3
max_binlog_size         = 100M
relay-log               = /var/lib/mysql/slave-relay.log
relay-log-index         = /var/lib/mysql/slave-relay-log.index

and I can see that the /var/lib/mysql_bin_logs/ folder remains at a constant size. However the disc is filling up and I think it is to do with the file descriptor's for these binary log file not being closed properly. When I restart MySQL, disk usage drops by several Gigabytes, suggesting that act of restarting is freeing up the space.

How do I prevent the disk being filled up this way other than restarting MySQL on a cronjob?

share|improve this question
Does a mysqladmin flush-logs free that space? – Stefan Förster Sep 25 '09 at 21:35

First I'd try lsof -u mysql while it's running to see what files MySQL has open. You may also find it more helpful to do lsof -u mysql | grep deleted to see files that MySQL still has open but are deleted. If it turns out to be the log files hanging around you could try issuing a FLUSH LOGS inside MySQL as a workaround and see if it closes them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.