We are about to setup MySQL Master-Slave replication on our production database. We intend to run backups from the slave (at the moment our master lags out for 15 mins every day whilst backups are run, taking our website offline).
- We run an average of 800 qps
- 95%+ of queries are SELECT statements
How can I estimate how fast the bin log will grow? What other information would be needed?
Our MySQL master database server currently has 4x 15k SAS disks in RAID 10.
Should I consider adding a separate RAID 1 (2 disks) array to hold the bin logs? I am concerned that writing to the bin log will slow down reads & writes to the main mysql data store.
There are two ways to figure that out
EXAMPLE #1
Supposed the binary logs are defined as follows:
Go into the OS and do this:
This will show you the binary logs and their respective UNIX timestamps
Simply subtract one timestamp from the previous one
What can you compute ?
You would have to script this computations for each binlog.
EXAMPLE #2
If you want to examine just the binary log alone, you can do this:
Look what it does:
EPILOGUE
You can calculate the number of seconds each binlog takes to generate and do your number crunching from there
Give it a Try !!!