Log buffering must be refreshed to ensure that the committed transactions are completely persistent. If you care more about performance than persistence, you can modify the innodb_flush_log_at_trx_commit variable to control the frequency of log buffering, possible settings are as follows:
0. Write the log buffer to the log file and refresh it every second, but do not do anything when the transaction is committed.
1. Write the log buffer to the log file and refresh the transaction to persistent storage every time it is committed. This is the default (and safest) setting, this setting ensures that no committed transactions are lost unless the disk or operating system is "pseudo" refreshed.
2. When each commit is performed, the log buffer is written to the log file, but it is not refreshed. InnoDB refresh every second. If the MySQL process crashes, 2 will not lose any transactions, if the entire server is down or powered off, some transactions will still be lost.
It is important to write the log buffer to the log file and refresh the log to the persistent storage.
In most operating systems, writing the buffer to logs simply transfers the data from the InnoDB memory buffer to the Operating System Buffer, which is also in the memory, data is not written to persistent storage.