Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optimal parameter configrations. #5303

Merged
merged 30 commits into from
Jan 22, 2021
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a64b6cc
Update check-before-deployment.md
pepezzzz Jan 13, 2021
52e39f9
Update check-before-deployment.md
pepezzzz Jan 13, 2021
9489620
Update check-before-deployment.md
pepezzzz Jan 13, 2021
54adeac
correct format
TomShawn Jan 13, 2021
d1582e8
correct list numbers
TomShawn Jan 13, 2021
a296cd9
Update check-before-deployment.md
pepezzzz Jan 13, 2021
70f465d
Update check-before-deployment.md
pepezzzz Jan 13, 2021
6757e6d
Update check-before-deployment.md
pepezzzz Jan 13, 2021
e269dd0
Update check-before-deployment.md
pepezzzz Jan 13, 2021
c5c06b5
Merge branch 'master' into master
TomShawn Jan 15, 2021
8f779b7
Merge branch 'master' into master
TomShawn Jan 20, 2021
6241fef
Update check-before-deployment.md
pepezzzz Jan 22, 2021
fa7a906
Update check-before-deployment.md
pepezzzz Jan 22, 2021
02a2faf
Update check-before-deployment.md
pepezzzz Jan 22, 2021
497e849
Update check-before-deployment.md
pepezzzz Jan 22, 2021
0069433
Update check-before-deployment.md
pepezzzz Jan 22, 2021
a104a56
Update check-before-deployment.md
pepezzzz Jan 22, 2021
50b1cf4
Update check-before-deployment.md
pepezzzz Jan 22, 2021
6e2c1f9
Update check-before-deployment.md
pepezzzz Jan 22, 2021
8e941a1
Update check-before-deployment.md
pepezzzz Jan 22, 2021
72f2d82
Merge branch 'master' into master
TomShawn Jan 22, 2021
072b0fa
Update check-before-deployment.md
pepezzzz Jan 22, 2021
2e3a961
Update check-before-deployment.md
pepezzzz Jan 22, 2021
e0480a2
Update check-before-deployment.md
pepezzzz Jan 22, 2021
fcd1e4e
Update check-before-deployment.md
pepezzzz Jan 22, 2021
d86cb9b
Update check-before-deployment.md
pepezzzz Jan 22, 2021
e6c99f2
Update check-before-deployment.md
TomShawn Jan 22, 2021
5f2ee20
Update check-before-deployment.md
TomShawn Jan 22, 2021
62d4728
Update check-before-deployment.md
pepezzzz Jan 22, 2021
2cc8592
refine format
TomShawn Jan 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
correct format
  • Loading branch information
TomShawn authored Jan 13, 2021
commit 54adeaca4565ff2bc46cfe3f3a6a376c3f474a1a
106 changes: 53 additions & 53 deletions check-before-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,72 +310,72 @@ sudo systemctl enable ntpd.service

5. 推荐使用 tuned 方式配置应用优化参数。
pepezzzz marked this conversation as resolved.
Show resolved Hide resolved

1. 执行 `tuned-adm list` 命令查看当前操作系统的 tuned 策略。
1. 执行 `tuned-adm list` 命令查看当前操作系统的 tuned 策略。

{{< copyable "shell-regular" >}}
{{< copyable "shell-regular" >}}

```bash
tuned-adm list
```
```bash
tuned-adm list
```

```
Available profiles:
- balanced - General non-specialized tuned profile
- desktop - Optimize for the desktop use-case
- hpc-compute - Optimize for HPC compute workloads
- latency-performance - Optimize for deterministic performance at the cost of increased power consumption
- network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
- network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks
- powersave - Optimize for low power consumption
- throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads
- virtual-guest - Optimize for running inside a virtual guest
- virtual-host - Optimize for running KVM guests
Current active profile: balanced
```
`Current active profile: balanced` 表示当前操作系统的 tuned 策略使用 balanced,建议在当前策略的基础上添加操作系统优化配置。
```
Available profiles:
- balanced - General non-specialized tuned profile
- desktop - Optimize for the desktop use-case
- hpc-compute - Optimize for HPC compute workloads
- latency-performance - Optimize for deterministic performance at the cost of increased power consumption
- network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
- network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks
- powersave - Optimize for low power consumption
- throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads
- virtual-guest - Optimize for running inside a virtual guest
- virtual-host - Optimize for running KVM guests
Current active profile: balanced
```

`Current active profile: balanced` 表示当前操作系统的 tuned 策略使用 balanced,建议在当前策略的基础上添加操作系统优化配置。

2. 创建新的 tuned 策略。

{{< copyable "shell-regular" >}}
{{< copyable "shell-regular" >}}

```bash
mkdir /etc/tuned/balanced-tidb-optimal/
vi /etc/tuned/balanced-tidb-optimal/tuned.conf
```

```
[main]
include=balanced
```bash
mkdir /etc/tuned/balanced-tidb-optimal/
vi /etc/tuned/balanced-tidb-optimal/tuned.conf
```

[cpu]
governor=performance
```
[main]
include=balanced

[vm]
transparent_hugepages=never
[cpu]
governor=performance

[disk]
devices_udev_regex=(ID_SERIAL=36d0946606d79f90025f3e09a0c1fc035)|(ID_SERIAL=36d0946606d79f90025f3e09a0c1f9e81)
elevator=noop
```
[vm]
transparent_hugepages=never

`include=balanced` 表示在现有的 balanced 策略基础上添加操作系统优化配置。
[disk]
devices_udev_regex=(ID_SERIAL=36d0946606d79f90025f3e09a0c1fc035)|(ID_SERIAL=36d0946606d79f90025f3e09a0c1f9e81)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有个疑问,如果用户因磁盘损坏等问题换盘,tuned 的行为是怎样的?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 ID_SERIAL 的话,需要重新编辑,因为正则匹配不上了。之前 ORACLE 用 udev 规则写磁盘阵列上的 LUN 的权限时,有时候会用 ID_VENDOR 把厂商 ID 给绑定。在我们的服务器内部磁盘的场景中,可能没有办法用上这种方法。

elevator=noop
```

`include=balanced` 表示在现有的 balanced 策略基础上添加操作系统优化配置。

3. 应用新的 tuned 策略。

{{< copyable "shell-regular" >}}
{{< copyable "shell-regular" >}}

```bash
tuned-adm profile balanced-tidb-optimal
```
```bash
tuned-adm profile balanced-tidb-optimal
```

6. 使用脚本的配置方式应用优化参数。如果已经使用 tuned 方式,请跳过本步骤。
pepezzzz marked this conversation as resolved.
Show resolved Hide resolved

1. 执行 `grubby` 命令查看默认内核版本。
1. 执行 `grubby` 命令查看默认内核版本。

> **注意:**
>
> 需安装 `grubby` 软件包。
> **注意:**
>
> 需安装 `grubby` 软件包。

{{< copyable "shell-regular" >}}

Expand All @@ -395,9 +395,9 @@ sudo systemctl enable ntpd.service
grubby --args="transparent_hugepage=never" --update-kernel /boot/vmlinuz-3.10.0-957.el7.x86_64
```

> **注意:**
>
> `--update-kernel` 后需要使用实际的默认内核版本。
> **注意:**
>
> `--update-kernel` 后需要使用实际的默认内核版本。

3. 执行 `grubby --info` 命令查看修改后的默认内核配置。

Expand All @@ -407,9 +407,9 @@ sudo systemctl enable ntpd.service
grubby --info /boot/vmlinuz-3.10.0-957.el7.x86_64
```

> **注意:**
>
> `--info` 后需要使用实际的默认内核版本。
> **注意:**
>
> `--info` 后需要使用实际的默认内核版本。

```
index=0
Expand Down