更改参数mysql参数,大幅提高写性能

innodb_flush_log_at_trx_commit = 0 

# If set to 1, InnoDB will flush (fsync) the transaction logs to the                                                                                                             

# disk at each commit, which offers full ACID behavior. If you are                                                                                                               
# willing to compromise this safety, and you are running small                                                                                                                   
# transactions, you may set this to 0 or 2 to reduce disk I/O to the                                                                                                             
# logs. Value 0 means that the log is only written to the log file and                                                                                                           
# the log file flushed to disk approximately once per second. Value 2                                                                                                            
# means the log is written to the log file at each commit, but the log                                                                                                           
# file is only flushed to disk approximately once per second.                                                                                                                    


sync_binlog = 0
If the value of this variable is greater than 0, the MySQL server synchronizes its binary log to disk (using fdatasync()) after every sync_binlog writes to the binary log. There is one write to the binary log per statement if autocommit is enabled, and one write per transaction otherwise. The default value of sync_binlog is 0, which does no synchronizing to disk. A value of 1 is the safest choice because in the event of a crash you lose at most one statement or transaction from the binary log. However, it is also the slowest choice (unless the disk has a battery-backed cache, which makes synchronization very fast).
If the value of sync_binlog is 0 (the default), no extra flushing is done. The server relies on the operating system to flush the file contents occasionally as for any other file. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值