# Why is the iblogfile files size big in the beginning?

**URL:** <https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530>\
**Category:** Other MySQL® Questions\
**Created:** [November 19, 2007, 6:41am UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530 "2007-11-19T06:41:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [November 19, 2007, 6:41am UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/1 "2007-11-19T06:41:01Z")

</div>

Dear All,  
I recently I install a mysql server with innodb storage engine as my main engine. Then I notice 2 big (320 mb each file) iblogfile immediately created when I installed my server. From what I learn this files are log files ? What logging do they do exactly? I am curious is that why the files size are so big from the start as there is no logging done at that moment right ? I am sure there is empty log in the beginning rite? Can view the contents of the files and how ? Thanks.

---

<div class="post-metadata">

**Author:** ![sterin](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sterin](https://forums.percona.com/u/sterin)\
**Post date:** [November 20, 2007, 10:44am UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/2 "2007-11-20T10:44:49Z")

</div>

Those files are for innodb’s internal use and are created at first startup of MySQL.  
They set to the size that you have set in the configuration file which should be in relation to how large innodb buffer pool that you are using.

All changes to the database are written to these log files before and after they are made to ensure that you don’t loose any transactions in case of a power failure.

---

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [November 20, 2007, 10:56am UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/3 "2007-11-20T10:56:42Z")

</div>

Dear Sterin,  
I what relation should I set size of the log file in terms of the innodb buffer pool ? I mean in what percentage is the best and appropriate. We cant see the contents of the iblogfiles rite ? So you said it will be keep the changes before and after they are made but will it be there forever or will be cleaned up routinely ? Thanks for your help.

---

<div class="post-metadata">

**Author:** ![sterin](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sterin](https://forums.percona.com/u/sterin)\
**Post date:** [November 20, 2007, 3:02pm UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/4 "2007-11-20T15:02:53Z")

</div>

Set it to 25-50% of the buffer pool when you have two (default and recommended) innodb log files.

No you never see the content of these files and they are always the same size.  
The files are each one half of a cyclic buffer that is continuously written to. So when it reaches the end of one file it starts with the other and when it reaches the end of that file it starts at the beginning of the first file again, etc.

So after these files have been created at startup you never do anything with them and they will neither grow or shrink over time.

---

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [November 20, 2007, 7:57pm UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/5 "2007-11-20T19:57:28Z")

</div>

Dear Sterin,  
Say my innodb buffer pool size is 1Gb so my iblogfile should be each around 125mb is it ? Actually what I am interested to learn is what is the contents in it? Is it sql statement or some other things ? When you say the contents are the same means what is exactly is the contents even I run different sql statements is it? Thanks.

---

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [November 20, 2007, 8:20pm UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/6 "2007-11-20T20:20:24Z")

</div>

Dear Sterin,  
Ok below some things I took from my.ini file.

innodb\_log\_buffer\_size=7M  
innodb\_buffer\_pool\_size=616M  
innodb\_log\_file\_size=308M

By looking at this it seems that my innodb\_log\_file\_size is 50% of my innodb\_buffer\_pool\_size. But the problem here is that I have 2 ib\_logfiles where each is 315392Kb which a bit confusing rite. So if you look in this case the total of log file size is nearly equals to my innodb\_buffer\_pool\_size. I have not done any manual change it is as I install only. Please guide me if this sizes are all ok or not ?

---

<div class="post-metadata">

**Author:** ![sterin](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sterin](https://forums.percona.com/u/sterin)\
**Post date:** [November 21, 2007, 2:27am UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/7 "2007-11-21T02:27:21Z")

</div>

The sizes are OK, the size isn’t really that important. Unless you set it incredibly small for which performance will suffer or incredibly large when recover in case of a power failure will take a very long time.

It’s a binary file so hence it doesn’t make any sense to look in them. It’s purely for InnoDB’s internal use. That’s what I meant with “you never do anything with them”.

---

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [November 21, 2007, 2:57am UTC](https://forums.percona.com/t/why-is-the-iblogfile-files-size-big-in-the-beginning/530/8 "2007-11-21T02:57:46Z")

</div>

Dear Sterin,  
Thanks for your answers. But to be specific so when your said 20-50% of buffer\_pool\_size does it mean each single file is 20-50% or the total of log file size is 20-50% of my buffer\_pool\_size ? I am guessing at each of the file is 20-50% of my buffer\_pool\_size rite? Thanks.
