From 2391c4819f5e3998f98a81d20409a680322f24c6 Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 Date: Mon, 19 Jul 2021 18:01:20 +0800 Subject: [PATCH 1/2] Add steps to get lightning goroutine --- tidb-lightning/tidb-lightning-faq.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tidb-lightning/tidb-lightning-faq.md b/tidb-lightning/tidb-lightning-faq.md index 1033900cf1276..4d77a7874e848 100644 --- a/tidb-lightning/tidb-lightning-faq.md +++ b/tidb-lightning/tidb-lightning-faq.md @@ -348,3 +348,19 @@ This error occurs usually because the CSV data file does not contain a header (t [mydumper.csv] header = false ``` + +## How to get goroutine information when TiDB Lightning is running + +1. If the configuration file of TiDB Lightning has specified [`status-port`](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-configuration), skip this step. Otherwise, you need to send USR1 signal to TiDB Lightning to enable `status-port`. + + Execute commands like `ps` to get the PID of TiDB Lightning, and then run the following command to check the log of TiDB Lightning: + + {{< copyable "shell-regular" >}} + + ```sh + kill -USR1 + ``` + + In the output of this command, the log of `starting HTTP server` / `start HTTP server` / `started HTTP server` shows new enabled `status-port`. + +2. Access `http://:/debug/pprof/goroutine?debug=2` to get goroutine information. From ce00b24dfd584f526efc922b4d29499d6114ae86 Mon Sep 17 00:00:00 2001 From: Liuxiaozhen12 <82579298+Liuxiaozhen12@users.noreply.github.com> Date: Thu, 5 Aug 2021 19:46:15 +0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tidb-lightning/tidb-lightning-faq.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tidb-lightning/tidb-lightning-faq.md b/tidb-lightning/tidb-lightning-faq.md index 4d77a7874e848..d24584f24ae0b 100644 --- a/tidb-lightning/tidb-lightning-faq.md +++ b/tidb-lightning/tidb-lightning-faq.md @@ -349,11 +349,11 @@ This error occurs usually because the CSV data file does not contain a header (t header = false ``` -## How to get goroutine information when TiDB Lightning is running +## How to get the runtime goroutine information of TiDB Lightning -1. If the configuration file of TiDB Lightning has specified [`status-port`](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-configuration), skip this step. Otherwise, you need to send USR1 signal to TiDB Lightning to enable `status-port`. +1. If [`status-port`](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-configuration) has been specified in the configuration file of TiDB Lightning, skip this step. Otherwise, you need to send the USR1 signal to TiDB Lightning to enable `status-port`. - Execute commands like `ps` to get the PID of TiDB Lightning, and then run the following command to check the log of TiDB Lightning: + Get the process ID (PID) of TiDB Lightning using commands like `ps`, and then run the following command: {{< copyable "shell-regular" >}} @@ -361,6 +361,6 @@ header = false kill -USR1 ``` - In the output of this command, the log of `starting HTTP server` / `start HTTP server` / `started HTTP server` shows new enabled `status-port`. + Check the log of TiDB Lightning. The log of `starting HTTP server` / `start HTTP server` / `started HTTP server` shows the newly enabled `status-port`. -2. Access `http://:/debug/pprof/goroutine?debug=2` to get goroutine information. +2. Access `http://:/debug/pprof/goroutine?debug=2` to get the goroutine information.