4 ms·
innodb_flush_log_at_trx_commit=0 or 2 are very common performance tweaks that trade some level (about a second) of data vulnerability for performance.
by aaronblohowiak 15y ago
innodb_flush_log_at_trx_commit=0 or 2 are very common performance tweaks that trade some level (about a second) of data vulnerability for performance.
- jamesaguilar 15y agoHmm, the thing I'm not really clear on is how this helps performance. The database has to do the same amount of work whether you commit before or after the sync, so why not just make all the commits wait until the sync has happened?
- aaronblohowiak 15y agofsync() is a blocking call, which requires confirmation from the disk before your process continues. roughly, this means that redis can't do anything while the fsync() happens. while this isn't any more work (cpu) it is significantly slower because of all of the time spent waiting.
- jamesaguilar 15y agoHmm . . . as long as the requests are not being handled on the same thread as the one doing the fsync, this shouldn't stop work in the process or make anything appreciably slower.