开发者

Faster server response

开发者 https://www.devze.com 2023-01-26 19:58 出处:网络
What should be the correct value for innodb-flush-log-at-trx-commit if I want to make the query faster at any cost?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号