From 4a9398ec2cf9cd3dab38bca8987b760d5e36458e Mon Sep 17 00:00:00 2001 From: Se-L Date: Tue, 26 May 2020 20:12:58 +0800 Subject: [PATCH 1/4] Update benchmark-tidb-using-tpcc.md --- benchmark/benchmark-tidb-using-tpcc.md | 31 ++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index 857b469560f6..4e15d50dec9a 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -70,22 +70,45 @@ ant | RAM | 128GB | | DISK | Optane 500GB SSD | -因为该型号 CPU 是 NUMA 架构,建议先用 `taskset` 进行绑核,首先用 `lscpu` 查看 NUMA node,比如: +因为该型号 CPU 是 NUMA 架构,建议用 `numactl` 进行绑核。首先[安装 numactl 工具](/check-before-deployment.md#安装-numactl-工具) ,然后用 `lscpu` 查看 NUMA node,比如: ```text NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38 NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 ``` -之后可以通过下面的命令来启动 TiDB: +之后可以通过修改 `{tidb_deploy_path}/scripts/run_tidb.sh` 启动脚本,加入 `numactl` 来启动 TiDB : {{< copyable "shell-regular" >}} ```shell -nohup taskset -c 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38 bin/tidb-server && \ -nohup taskset -c 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 bin/tidb-server +$ cat run_tidb.sh +#!/bin/bash +set -e + +ulimit -n 1000000 + +# WARNING: This file was auto-generated. Do not edit! +# All your edit might be overwritten! +DEPLOY_DIR=/home/damon/deploy/tidb1-1 + +cd "${DEPLOY_DIR}" || exit 1 + +export TZ=Asia/Shanghai + +# 同一台机器不同的 TiDB 实例需要指定不同的 cpunodebind 以及 membind;来绑定不同的 Numa node +exec numactl --cpunodebind=0 --membind=0 bin/tidb-server \ + -P 4111 \ + --status="10191" \ + --advertise-address="172.16.4.53" \ + --path="172.16.4.10:2490" \ + --config=conf/tidb.toml \ + --log-slow-query="/home/damon/deploy/tidb1-1/log/tidb_slow_query.log" \ + --log-file="/home/damon/deploy/tidb1-1/log/tidb.log" 2>> "/home/damon/deploy/tidb1-1/log/tidb_stderr.log" ``` +>注意:直接修改 run_tidb.sh 可能会被覆盖。因此在生产环境中,如有绑核需求,建议使用 Tiup 绑核 + 最后,可以选择部署一个 HAproxy 来进行多个 TiDB node 的负载均衡,推荐配置 nbproc 为 CPU 核数。 ## 配置调整 From 8b06f3fbf5920aac433078531d2c2c76a87fc471 Mon Sep 17 00:00:00 2001 From: Se-L Date: Tue, 26 May 2020 22:15:04 +0800 Subject: [PATCH 2/4] Update benchmark-tidb-using-tpcc.md --- benchmark/benchmark-tidb-using-tpcc.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index 4e15d50dec9a..bd0064ff17e1 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -77,12 +77,9 @@ NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38 NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 ``` -之后可以通过修改 `{tidb_deploy_path}/scripts/run_tidb.sh` 启动脚本,加入 `numactl` 来启动 TiDB : +之后可以通过修改 `{tidb_deploy_path}/scripts/run_tidb.sh` 启动脚本,加入 `numactl` 来启动 TiDB: -{{< copyable "shell-regular" >}} - -```shell -$ cat run_tidb.sh +```text #!/bin/bash set -e From 43bca56912a464fb5f4740cefb22672b83b8e09b Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 26 May 2020 23:13:46 +0800 Subject: [PATCH 3/4] Update benchmark/benchmark-tidb-using-tpcc.md --- benchmark/benchmark-tidb-using-tpcc.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index bd0064ff17e1..61e01a4695a1 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -104,7 +104,9 @@ exec numactl --cpunodebind=0 --membind=0 bin/tidb-server \ --log-file="/home/damon/deploy/tidb1-1/log/tidb.log" 2>> "/home/damon/deploy/tidb1-1/log/tidb_stderr.log" ``` ->注意:直接修改 run_tidb.sh 可能会被覆盖。因此在生产环境中,如有绑核需求,建议使用 Tiup 绑核 +> **注意:** +> +> 直接修改 `run_tidb.sh` 可能会被覆盖,因此在生产环境中,如有绑核需求,建议使用 TiUP 绑核。 最后,可以选择部署一个 HAproxy 来进行多个 TiDB node 的负载均衡,推荐配置 nbproc 为 CPU 核数。 From 7faff6e63d6808bb37ca28675be3783cce3d76ad Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 26 May 2020 23:17:16 +0800 Subject: [PATCH 4/4] Update format --- benchmark/benchmark-tidb-using-tpcc.md | 64 ++++++++++++++------------ 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index 61e01a4695a1..d2e908d72e8a 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -57,7 +57,7 @@ ant ## 部署 TiDB 集群 -对于 1000 WAREHOUSE 我们将在 3 台服务器上部署集群。 +对于 1000 WAREHOUSE,在 3 台服务器上部署集群。 在 3 台服务器的条件下,建议每台机器部署 1 个 TiDB,1 个 PD 和 1 个 TiKV 实例。 @@ -70,45 +70,49 @@ ant | RAM | 128GB | | DISK | Optane 500GB SSD | -因为该型号 CPU 是 NUMA 架构,建议用 `numactl` 进行绑核。首先[安装 numactl 工具](/check-before-deployment.md#安装-numactl-工具) ,然后用 `lscpu` 查看 NUMA node,比如: +因为该型号 CPU 是 NUMA 架构,建议用 `numactl` 进行绑核。 -```text -NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38 -NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 -``` +1. [安装 numactl 工具](/check-before-deployment.md#安装-numactl-工具) 。 -之后可以通过修改 `{tidb_deploy_path}/scripts/run_tidb.sh` 启动脚本,加入 `numactl` 来启动 TiDB: +2. 用 `lscpu` 查看 NUMA node,比如: -```text -#!/bin/bash -set -e + ```text + NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38 + NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 + ``` -ulimit -n 1000000 +3. 通过修改 `{tidb_deploy_path}/scripts/run_tidb.sh` 启动脚本,加入 `numactl` 来启动 TiDB: -# WARNING: This file was auto-generated. Do not edit! -# All your edit might be overwritten! -DEPLOY_DIR=/home/damon/deploy/tidb1-1 + ```text + #!/bin/bash + set -e -cd "${DEPLOY_DIR}" || exit 1 + ulimit -n 1000000 -export TZ=Asia/Shanghai + # WARNING: This file was auto-generated. Do not edit! + # All your edit might be overwritten! + DEPLOY_DIR=/home/damon/deploy/tidb1-1 -# 同一台机器不同的 TiDB 实例需要指定不同的 cpunodebind 以及 membind;来绑定不同的 Numa node -exec numactl --cpunodebind=0 --membind=0 bin/tidb-server \ - -P 4111 \ - --status="10191" \ - --advertise-address="172.16.4.53" \ - --path="172.16.4.10:2490" \ - --config=conf/tidb.toml \ - --log-slow-query="/home/damon/deploy/tidb1-1/log/tidb_slow_query.log" \ - --log-file="/home/damon/deploy/tidb1-1/log/tidb.log" 2>> "/home/damon/deploy/tidb1-1/log/tidb_stderr.log" -``` + cd "${DEPLOY_DIR}" || exit 1 + + export TZ=Asia/Shanghai + + # 同一台机器不同的 TiDB 实例需要指定不同的 cpunodebind 以及 membind;来绑定不同的 Numa node + exec numactl --cpunodebind=0 --membind=0 bin/tidb-server \ + -P 4111 \ + --status="10191" \ + --advertise-address="172.16.4.53" \ + --path="172.16.4.10:2490" \ + --config=conf/tidb.toml \ + --log-slow-query="/home/damon/deploy/tidb1-1/log/tidb_slow_query.log" \ + --log-file="/home/damon/deploy/tidb1-1/log/tidb.log" 2>> "/home/damon/deploy/tidb1-1/log/tidb_stderr.log" + ``` -> **注意:** -> -> 直接修改 `run_tidb.sh` 可能会被覆盖,因此在生产环境中,如有绑核需求,建议使用 TiUP 绑核。 + > **注意:** + > + > 直接修改 `run_tidb.sh` 可能会被覆盖,因此在生产环境中,如有绑核需求,建议使用 TiUP 绑核。 -最后,可以选择部署一个 HAproxy 来进行多个 TiDB node 的负载均衡,推荐配置 nbproc 为 CPU 核数。 +4. 选择部署一个 HAproxy 来进行多个 TiDB node 的负载均衡,推荐配置 nbproc 为 CPU 核数。 ## 配置调整