mariadb系统变量之(二)性能优化

1. 最大连接数配置:max_connections

2. 缓存相关的配置:

innodb_buffer_pool_size:缓存大小配置

innodb_buffer_pool_instances:缓存实例个数

  • Description: If innodb_buffer_pool_size is set to more than 1GB, innodb_buffer_pool_instances divides the InnoDB buffer pool into this many instances. The default was 1 in MariaDB 5.5, but for large systems with buffer pools of many gigabytes, many instances can help reduce contention concurrency. The default is 8 in MariaDB 10 (except on Windows 32-bit, where it varies according to innodb_buffer_pool_size, or from MariaDB 10.2.2, where it is set to 1 if innodb_buffer_pool_size < 1GB). Each instance manages its own data structures and takes an equal portion of the total buffer pool size, so for example if innodb_buffer_pool_size is 4GB and innodb_buffer_pool_instances is set to 4, each instance will be 1GB. Each instance should ideally be at least 1GB in size.
  • Commandline: --innodb-buffer-pool-instances=#
  • Scope: Global
  • Dynamic: No
  • Data Type: numeric
  • Default Value: <= MariaDB 10.0.31
  • Default Value: >= MariaDB 10.0.481 (>= MariaDB 10.2.2 if innodb_buffer_pool_size < 1GB), or dependent on innodb_buffer_pool_size (Windows 32-bit)
  • Introduced: MariaDB 5.5.20

3. IO相关的配置

innodb_io_capacity:用来当刷新脏数据时,控制MySQL每秒执行的写IO量。

  • Description: Limit on I/O activity for XtraDB/InnoDB background tasks, including merging data from the insert buffer and flushing pages. Should be set to around the number of I/O operations per second that system can handle, based on the type of drive/s being used. You can also set it higher when the server starts to help with the extra workload at that time, and then reduce for normal use. Ideally, opt for a lower setting, as at higher value data is removed from the buffers too quickly, reducing the effectiveness of caching. See also innodb_flush_sync.
  • Commandline: --innodb-io-capacity=#
  • Scope: Global
  • Dynamic: Yes
  • Data Type: numeric
  • Default Value: 200
  • Range: 100 to 18446744073709551615 (264-1)

Reference:

1. https://mariadb.com/kb/en/library/innodb-system-variables

2. https://mariadb.com/kb/en/library/server-system-variables/

3. MySQL性能调优 – 你必须了解的15个重要变量

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值