我通常使用的经验法则是基于Linux环境中的一个特殊程序
numactl --hardware
Run Code Online (Sandbox Code Playgroud)
当我运行这个时,我得到以下输出
sh-4.1# numactl --hardware
available: 4 nodes (0-3)
node 0 cpus: 0 1 2 3
node 0 size: 49151 MB
node 0 free: 241 MB
node 1 cpus: 4 5 6 7
node 1 size: 32768 MB
node 1 free: 39 MB
node 2 cpus: 8 9 10 11
node 2 size: 49152 MB
node 2 free: 49 MB
node 3 cpus: 12 13 14 15
node 3 size: 32752 MB
node 3 free: 32 MB
node distances:
node 0 1 2 3
0: 10 16 16 16
1: 16 10 16 16
2: 16 16 10 16
3: 16 16 16 10
Run Code Online (Sandbox Code Playgroud)
这很快就会告诉我我的数据库服务器上有多少个 CPU 和内核。
一般来说,我将innodb_buffer_pool_instances设置为物理CPU的数量或核心的数量。根据您的具体情况,我将innodb_buffer_pool_instances设置为 4 或 16。
如果您使 InnoDB 缓冲池大于已安装 RAM 的 50%,mysqld 会导致操作系统开始交换......糟糕!!!!如果您需要那么大的缓冲池,那么调整innodb_buffer_pool_instances就变得更加重要。
innodb_buffer_pool_instances一经引入,我就立即进行了实验。我有一个客户端,它有 192GB 数据库服务器、双六核和 162GB 缓冲池。我只是将其设置为 2,一切都很好。请参阅我 2011 年 2 月 12 日发表的旧帖子:How do you adjustment MySQL for a Heavy InnoDB 工作负载?
归档时间: |
|
查看次数: |
3730 次 |
最近记录: |