Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Today, I checked the /var/lib/mysql/ directory of a server in a master-master replication setup and noticed there were about 3,600 slave-relay.00xxxx files in there (where "xxxx" is an incrementing integer).

They appear to be binary log files and don't take up much space (only about 42K), but are they an indication that something is wrong?

They range in date from August until today with about 25 per day.

Thanks for any help.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can read this from dev.mysql.

Mysqld appends a numeric extension to the binary log basename to generate binary log file names.
The number increases each time the server creates a new log file, thus creating an ordered series of files.
The server creates a new file in the series each time it starts or flushes the logs. 
The server also creates a new binary log file automatically after the current log's size reaches max_binlog_size.
A binary log file may become larger than max_binlog_size if you are using large transactions because
a transaction is written to the file in one piece, never split between files.

In summary, you can relate the number of log files to the number of transactions and queries you are executing. Also, the maximum size of log file can affect how many files you will have.

If you know your database is always busy executing queries (doing insert/update/delete), this should be normal.

share|improve this answer
    
That information does help, but I'm still confused. This database server sees over 17k inserts and 500k selects per day. This amounts to ~4.5MB of new data per day. It seems like if the log files related to the number of queries, I would have a lot more than 3600 files and 42KB. Also, why does it keep them for so long? The oldest files are over 3 months old! –  Andrew Jan 5 '11 at 18:40

Your Answer

 
discard

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.