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.9, 8388608 (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

  • Description: Number of physical files in the InnoDB redo log.
  • Commandline: --innodb-log-files-in-group=#
  • Scope: Global
  • Dynamic: No
  • Data Type: numeric
  • Default Value: 1 (>= MariaDB 10.5), 2 (<= MariaDB 10.4)
  • Range: 1 to 100 (>= MariaDB 10.2.4), 2 to 100 (<= MariaDB 10.2.3)

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

你可能感兴趣的:(MariaDB,mariadb,mysql)