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

Extend the debug/zip API to other tools (Lightning, Dumpling, BR) #55715

Open
kennytm opened this issue Aug 28, 2024 · 1 comment
Open

Extend the debug/zip API to other tools (Lightning, Dumpling, BR) #55715

kennytm opened this issue Aug 28, 2024 · 1 comment
Labels
component/br This issue is related to BR of TiDB. component/dumpling This is related to Dumpling of TiDB. component/lightning This issue is related to Lightning of TiDB. type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@kennytm
Copy link
Contributor

kennytm commented Aug 28, 2024

Feature Request

Is your feature request related to a problem? Please describe:

The debug/zip HTTP endpoint is only available in TiDB (via #9651 at http://[::]:10080/debug/zip) and PD (via tikv/pd#4017 at http://[::]:2379/debug/pprof/zip).

In all other components (TiKV, BR/Lightning/Dumpling, DM/TiCDC, etc.) one can only retrieve the pprof one by one, which

  1. this is very tedious
  2. the profiles each require different set of parameters (/profile need ?seconds=N, /goroutine need ?debug=2) which is very error-prone, in particular with the non-CPU profiles accidentally adding ?seconds=N will produce unusable garbage.

Describe the feature you'd like:

Bring the debug/zip API to all mentioned components (this issue is created for BR + Lightning + Dumpling in this repository only).

Describe alternatives you've considered:

Distribute a standardized script to fetch all the pprof.

#!/bin/sh
set -ex

ENDPOINT="$1"
SECONDS="$2"
OUTDIR="$3"

mkdir -p "$OUTDIR"
curl -o "$OUTDIR/goroutine" "$ENDPOINT/debug/pprof/goroutine?debug=2"
curl -o "$OUTDIR/heap" "$ENDPOINT/debug/pprof/heap?gc=1"
curl -o "$OUTDIR/mutex" "$ENDPOINT/debug/pprof/mutex"
curl -o "$OUTDIR/profile" "$ENDPOINT/debug/pprof/profile?seconds=$SECONDS"

This can only download the pprof profiles. The debug/zip output also contained the config and version, which may or may not be useful.

Teachability, Documentation, Adoption, Migration Strategy:

Note that TiDB's /debug/zip and PD's /debug/pprof/zip themselves are not yet documented anywhere in PingCAP's docs website. So these can be grouped together to introduce as a standardized debug interface for all PingCAP components. (Not sure about how to resolve the difference between TiDB and PD's URL)

@kennytm kennytm added type/feature-request Categorizes issue or PR as related to a new feature. component/br This issue is related to BR of TiDB. component/lightning This issue is related to Lightning of TiDB. component/dumpling This is related to Dumpling of TiDB. labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/br This issue is related to BR of TiDB. component/dumpling This is related to Dumpling of TiDB. component/lightning This issue is related to Lightning of TiDB. type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants
@kennytm and others