mariadb系统变量之(三)redo log

1. redo日志大小配置:innodb_log_file_size

  • Description: Size in bytes of each InnoDB redo log file in the log group. The combined size can be no more than 4GB prior to MariaDB 10.0, and no more than 512GB in MariaDB 10.0 and later. Larger values mean less disk I/O due to less flushing checkpoint activity, but also slower recovery from a crash.
  • Commandline: --innodb-log-file-size=#
  • Scope: Global
  • Dynamic: No
  • Data Type: numeric
  • Default Value: 50331648 (48MB) (from MariaDB 10.0), 5242880 (5MB) (before MariaDB 10.0)
  • Range: 1048576 to 512GB (1MB to 512GB) (>= MariaDB 10.0), 1048576 to 4294967295 (1MB to 4096MB) (<= MariaDB 5.5)

2. redo日志缓存大小:innodb_log_buffer_size

  • Description: Size in bytes of the buffer for writing InnoDB redo log files to disk. Increasing this means larger transactions can run without needing to perform disk I/O before committing.
  • Commandline: --innodb-log-buffer-size=#
  • Scope: Global
  • Dynamic: No
  • Data Type: numeric
  • Default Value: 16777216 (16MB) >= MariaDB 10.1.98388608 (8MB) <= MariaDB 10.1.8
  • Range: 262144 to 4294967295 (256KB to 4096MB)

3. redo日志落地(缓存-->磁盘)的策略配置:innodb_flush_log_at_trx_commit

  • Description: Set to 1, along with sync_binlog=1 for the greatest level of fault tolerance. The value of innodb_use_global_flush_log_at_trx_commit determines whether this variable can be reset with a SET statement or not.
    • 1 The default, the log buffer is written to the InnoDB redo log file and a flush to disk performed after each transaction. This is required for full ACID compliance.
    • 0 Nothing is done on commit; rather the log buffer is written and flushed to the InnoDB redo log once a second. This gives better performance, but a server crash can erase the last second of transactions.
    • 2 The log buffer is written to the InnoDB redo log after each commit, but flushing takes place once a second. Performance is slightly better, but a OS or power outage can cause the last second's transactions to be lost.
    • 3 (from MariaDB 10.0) Emulates MariaDB 5.5 group commit (3 syncs per group commit). See Binlog group commit and innodb_flush_log_at_trx_commit.
  • Commandline: --innodb-flush-log-at-trx-commit[=#]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: enumeration
  • Default Value: 1
  • Valid Values: 012 or 3 (from MariaDB 10.0)

4. redo日志的个数配置:innodb_log_files_in_group

5. redo日志的存储路径:innodb_log_group_home_dir

  • Description: Path to the InnoDB redo log files. If none is specified, innodb_log_files_in_group files named ib_logfile0 and so on, with a size of innodb_log_file_size are created in the data directory.
  • Commandline: --innodb-log-group-home-dir=path
  • Scope: Global
  • Dynamic: No
  • Data Type: directory name
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值