# how to calculate a proper log file size

**URL:** <https://forums.percona.com/t/how-to-calculate-a-proper-log-file-size/3570>\
**Category:** Percona XtraBackup\
**Created:** [June 25, 2014, 8:35am UTC](https://forums.percona.com/t/how-to-calculate-a-proper-log-file-size/3570 "2014-06-25T08:35:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lenny\_Andersen](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@Lenny\_Andersen](https://forums.percona.com/u/Lenny_Andersen)\
**Post date:** [June 25, 2014, 8:35am UTC](https://forums.percona.com/t/how-to-calculate-a-proper-log-file-size/3570/1 "2014-06-25T08:35:59Z")

</div>

Hi,

I’m creating a backup plan for my MySQL Server (5.5). I was thinking about a full backup every sunday morning and an incremental backup monday - saturday.  
I figured that innobackupex pretty much will do the trick for me.

So far so good.

I was reading about how the backup is done, and I understand that the incremental backup is done by reading the changes in the logfile since last backup (Based on the LSN).

What happens if my logfile is i.e. 5 MB but in the time between two backups there is written 20 MB to the log.

I guess I won’t be able to create a valid incremental backup since 15MB of information must be missing in the log?  
and I also guess I will have to increase the log file size to fix this problem?

But how do I calculate a proper size for the logfile?

any “best practices” on this matter?

---

<div class="post-metadata">

**Author:** ![miguelangelnieto](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@miguelangelnieto](https://forums.percona.com/u/miguelangelnieto)\
**Post date:** [June 26, 2014, 5:31pm UTC](https://forums.percona.com/t/how-to-calculate-a-proper-log-file-size/3570/2 "2014-06-26T17:31:08Z")

</div>

The incremental backup is not taken reading the redo log file. What Xtrabackup does is the following:

- When a full backup is taken, it writes the last LSN (log sequence number) copied on that backup to a file. Let’s say it is 500.
- When you take an incremental, xtrabackup reads that file and checks that the incremental should continue on LSN 500… Then, it scans InnoDB data and copies all pages with a LSN greater than 500.

So, for incremental backups the redo log size is not important. Maybe you read something about log archiving feature in Percona Server, but that’s a different way to do the backups.

Anyway, having a proper size of the logfile is good for overall performance, so check this blog post to learn how to calculate it:

[url][http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size/[/url]](http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size/%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![Lenny\_Andersen](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@Lenny\_Andersen](https://forums.percona.com/u/Lenny_Andersen)\
**Post date:** [July 11, 2014, 3:48am UTC](https://forums.percona.com/t/how-to-calculate-a-proper-log-file-size/3570/3 "2014-07-11T03:48:01Z")

</div>

Thanks for the answer and the link. Very helpful 🙂
