73c26def创建于 2021年6月16日历史提交
# Copyright (c) 2020 Huawei Technologies Co., Ltd.
# A-Tune is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#     http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# Create: 2020-07-23
#
# mysql 2p sysbench A-Tune configuration
#
[main]
include = default-default

[kernel_config]
#TODO CONFIG

[bios]
#TODO CONFIG

[bootloader.grub2]
iommu.passthrough = 1
iommu.strict = 0
sched_steal_node_limit = 4

[sysfs]
block/{disk}/queue/read_ahead_kb = 64
block/{disk}/queue/nr_requests = 2048
block/{disk}/device/queue_depth = 256
kernel/mm/transparent_hugepage/defrag = never
kernel/mm/transparent_hugepage/enabled = never
kernel/debug/sched_features = NO_WAKEUP_PREEMPTION

[systemctl]
sysmonitor = stop
irqbalance = stop
firewalld = stop

[sysctl]
vm.swappiness = 1
vm.dirty_ratio = 5
# schedule
kernel.sched_cfs_bandwidth_slice_us = 21000
kernel.sched_migration_cost_ns = 1381000
kernel.sched_latency_ns = 16110000
kernel.sched_min_granularity_ns = 8250000
kernel.sched_nr_migrate = 53
kernel.sched_wakeup_granularity_ns = 50410000
kernel.sched_autogroup_enabled = 0
kernel.numa_balancing = 0

# network core
net.core.rmem_default = 21299200
net.core.rmem_max = 21299200
net.core.wmem_default = 21299200
net.core.wmem_max = 21299200
net.ipv4.tcp_rmem = 40960 8738000 62914560
net.ipv4.tcp_wmem = 40960 8738000 62914560
net.core.dev_weight = 97

# support more connections for mysql
net.ipv4.tcp_max_syn_backlog = 20480
net.core.somaxconn = 1280
net.ipv4.tcp_max_tw_buckets = 360000

[script]
prefetch = off

[ulimit]
{user}.hard.nofile = 102400
{user}.soft.nofile = 102400

[schedule_policy]
#TODO CONFIG

[check]
#TODO CONFIG

[tip]
use xfs and enable noatime or nodirname to prevent the inode access records from being updated = filesystem
set innodb_numa_interleave to ON = application
add -O3 compilation parameter in cmake = application
set --innodb-flush-log-at-trx-commit=0 and --sync-binlog=0 can extremely improve performance but lose data reliability = application
set --innodb-io-capacity, --innodb-write-io-threads, --innodb-read-io-threads, --innodb-spin-wait-delay, --innodb_sync-spin-loops, --innodb-log-file-size, --innodb-log-files-in-group, --innodb-buffer-pool-instances, --innodb-log-buffer-size, --innodb-page-cleaners, --innodb-lru-scan-depth, --innodb-thread-concurrency to an appropriate value = application