From 6b775ed97f684dc231abc674511c006fe5f79f3c Mon Sep 17 00:00:00 2001 From: ireneontheway Date: Mon, 6 Jul 2020 19:02:49 +0800 Subject: [PATCH 1/6] Update benchmark-tidb-using-tpcc.md --- benchmark/benchmark-tidb-using-tpcc.md | 38 +++++++++++++++++++++----- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/benchmark/benchmark-tidb-using-tpcc.md b/benchmark/benchmark-tidb-using-tpcc.md index ec75c1c500da6..eaf9e6851075e 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -68,23 +68,47 @@ 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 an NUMA architecture, it is recommended to bind the core using `numactl`. + +2. Start TiDB using the following command: ```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 modifying the starting script `{tidb_deploy_path}/scripts/run_tidb.sh` and adding `numactl`: - {{< copyable "shell-regular" >}} + ```text + #!/bin/bash + set -e - ```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 + 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 + + # Different TiDB instances on the same machine need to specify different cpunodebind and membind 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" ``` -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 a HAproxy to balance the load of multiple TiDB nodes. It is recommended to configure `nbproc` as the number of CPU cores. ## Edit the configuration From 78e50aba1575ca535baf16a1c0d9018aea8b4a83 Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:40:12 +0800 Subject: [PATCH 2/6] Update benchmark/benchmark-tidb-using-tpcc.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- 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 eaf9e6851075e..766edb49908f1 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -68,7 +68,7 @@ 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 `numactl`. +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. Start TiDB using the following command: From 0d21027883e7bd8d95dffbf73b394fa01d4c00c3 Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:41:37 +0800 Subject: [PATCH 3/6] Update benchmark/benchmark-tidb-using-tpcc.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- 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 766edb49908f1..b98547c37bbcf 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -108,7 +108,7 @@ For example, the hardware configuration is as follows: > > 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 a HAproxy to balance the load of multiple TiDB nodes. It is recommended to configure `nbproc` as the number of CPU cores. +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 cec0a7a5bbfac145cecb700c578b22810192e66a Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:42:00 +0800 Subject: [PATCH 4/6] Update benchmark/benchmark-tidb-using-tpcc.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- 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 b98547c37bbcf..eca2ca7dae26c 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -93,7 +93,7 @@ For example, the hardware configuration is as follows: export TZ=Asia/Shanghai - # Different TiDB instances on the same machine need to specify different cpunodebind and membind to bind different Numa nodes + # 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" \ From 5725df280b517dc6b2cb632667db13c9ff07b735 Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:42:12 +0800 Subject: [PATCH 5/6] Update benchmark/benchmark-tidb-using-tpcc.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- 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 eca2ca7dae26c..2074e6ddea875 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -77,7 +77,7 @@ For example, the hardware configuration is as follows: NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39 ``` -3. Start TiDB by modifying the starting script `{tidb_deploy_path}/scripts/run_tidb.sh` and adding `numactl`: +3. Start TiDB by adding `numactl` to the `{tidb_deploy_path}/scripts/run_tidb.sh` start-up script: ```text #!/bin/bash From eb43e5f125a838e80acd7d455468c71cbbd1ef95 Mon Sep 17 00:00:00 2001 From: ireneontheway <48651140+ireneontheway@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:43:32 +0800 Subject: [PATCH 6/6] Update benchmark/benchmark-tidb-using-tpcc.md Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- 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 2074e6ddea875..b5e43de2fe2fb 100644 --- a/benchmark/benchmark-tidb-using-tpcc.md +++ b/benchmark/benchmark-tidb-using-tpcc.md @@ -70,7 +70,7 @@ For example, the hardware configuration is as follows: 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. Start TiDB using the following command: +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