what is the best configuration for innodb_flush_log_at_trx_commit?
innodb_flush_log_at_trx_commit  has default value of 1 - To disk on each transaction commit. is extremely expensive. Your applications can get incredible performance boost if you change the value to 2 - To OS cache on each transaction commit. To disk every second.

With a value of 2, only an operating system crash or a power outage can erase the last second of transactions. However, InnoDB's crash recovery is not affected and thus crash recovery does work regardless of the value.