From a4ab4c6859f9919f1e90b632395c9859007a3cc6 Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:57:45 +0800 Subject: [PATCH 1/5] cherry pick #3173 to release-3.1 Signed-off-by: ti-srebot --- benchmark/benchmark-tidb-using-tpcc.md | 38 ++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index 8b87417413b02..955570e806f21 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -62,21 +62,53 @@ For example, the hardware configuration is as follows: | RAM | 128GB | | DISK | Optane 500GB SSD | -1. Because this type of CPU has an NUMA architecture, it is recommended to bind the core using `taskset` and view the NUMA node using `lscpu`. For example: +1. Because this type of CPU has a NUMA architecture, it is recommended to [bind the core using `numactl`](/check-before-deployment.md#install-the-numactl-tool). + +2. Execute the `lscpu` command to view the NUMA nodes. The result is similar to: ```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 ``` -2. Start TiDB using the following command: +3. Start TiDB by adding `numactl` to the `{tidb_deploy_path}/scripts/run_tidb.sh` start-up script: +<<<<<<< HEAD ```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 +======= + ```text + #!/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 + + # You need to specify different cpunodebind and membind for different TiDB instances on the same machine to bind different Numa nodes. + 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" +>>>>>>> 9124427... Update benchmark-tidb-using-tpcc.md (#3173) ``` -3. You can deploy a HAproxy to balance the load of multiple TiDB nodes. It is recommended to configure `nbproc` as the number of CPU cores. + > **Note:** + > + > Direct modification of `run_tidb.sh` may be overwritten. So in a production environment, it is recommended to use TiUP if you need to bind the core. + +4. You can deploy an HAproxy to balance the loads on multiple TiDB nodes. It is recommended to configure `nbproc` as the number of CPU cores. ## Edit the configuration From 3fade340278fa56310a387804e0508c53710e61a Mon Sep 17 00:00:00 2001 From: ireneontheway Date: Tue, 7 Jul 2020 19:54:44 +0800 Subject: [PATCH 2/5] Update benchmark-tidb-using-tpcc.md solve conflicts --- benchmark/benchmark-tidb-using-tpcc.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index 955570e806f21..526eed536a727 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -73,35 +73,9 @@ For example, the hardware configuration is as follows: 3. Start TiDB by adding `numactl` to the `{tidb_deploy_path}/scripts/run_tidb.sh` start-up script: -<<<<<<< HEAD ```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 -======= - ```text - #!/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 - - # You need to specify different cpunodebind and membind for different TiDB instances on the same machine to bind different Numa nodes. - 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" ->>>>>>> 9124427... Update benchmark-tidb-using-tpcc.md (#3173) ``` > **Note:** From a1a357e7f417c324fb214d754de4ffd38fbf2f3a Mon Sep 17 00:00:00 2001 From: ireneontheway Date: Tue, 7 Jul 2020 20:10:28 +0800 Subject: [PATCH 3/5] Update benchmark-tidb-using-tpcc.md --- benchmark/benchmark-tidb-using-tpcc.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index 526eed536a727..932d6498e4117 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -73,9 +73,29 @@ For example, the hardware configuration is as follows: 3. Start TiDB by adding `numactl` to the `{tidb_deploy_path}/scripts/run_tidb.sh` start-up script: - ```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 + ```text + #!/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 + + # You need to specify different cpunodebind and membind for different TiDB instances on the same machine to bind different Numa nodes. + 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" ``` > **Note:** From 10136d6510b2906421a0abe62452b835170c5ca1 Mon Sep 17 00:00:00 2001 From: ireneontheway Date: Tue, 7 Jul 2020 20:29:26 +0800 Subject: [PATCH 4/5] Update benchmark-tidb-using-tpcc.md change the dead link --- benchmark/benchmark-tidb-using-tpcc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index 932d6498e4117..a404323ced62d 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -62,7 +62,7 @@ For example, the hardware configuration is as follows: | RAM | 128GB | | DISK | Optane 500GB SSD | -1. Because this type of CPU has a NUMA architecture, it is recommended to [bind the core using `numactl`](/check-before-deployment.md#install-the-numactl-tool). +1. Because this type of CPU has a NUMA architecture, it is recommended to [bind the core using `numactl`](https://docs.pingcap.com/tidb/v4.0/check-before-deployment#安装-numactl-工具). 2. Execute the `lscpu` command to view the NUMA nodes. The result is similar to: From 350b025b49dafe272d4fedfcc3f9312a3b2bc55e Mon Sep 17 00:00:00 2001 From: ireneontheway Date: Tue, 7 Jul 2020 20:31:56 +0800 Subject: [PATCH 5/5] Update benchmark-tidb-using-tpcc.md change dead links --- benchmark/benchmark-tidb-using-tpcc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index a404323ced62d..389459f749784 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -62,7 +62,7 @@ For example, the hardware configuration is as follows: | RAM | 128GB | | DISK | Optane 500GB SSD | -1. Because this type of CPU has a NUMA architecture, it is recommended to [bind the core using `numactl`](https://docs.pingcap.com/tidb/v4.0/check-before-deployment#安装-numactl-工具). +1. Because this type of CPU has a NUMA architecture, it is recommended to [bind the core using `numactl`](https://docs.pingcap.com/tidb/v4.0/check-before-deployment#install-the-numactl-tool). 2. Execute the `lscpu` command to view the NUMA nodes. The result is similar to: