Faster server response
What should be the correct value for innodb-flush-log-at-trx-commit if I want to make the query faster at any cost? I do not bother about data integrity at this moment. I have set the following in my.cnf
innodb_flush_method=O_DIRECT
innodb-flush-log-at开发者_StackOverflow中文版-trx-commit = 2
Is it correct?
innodb-flush-log-at-trx-commit = 0 is slightly faster than 2, but less durable. If you are just reimporting data = 0 is fine, but the savings are not (usually) high enough to toleration the added losses.
If you want to disable a bunch of features for speed here they are:
- innodb_doublewrite = 0
- innodb_checksums = 0
- innodb_locks_unsafe_for_binlog
- (session) SET foreign_key_checks = 0
- log-bin = 0
- innodb_support_xa = 0
Not that I don't recommend any of this. Please be careful with this advice, it is not for production.
精彩评论