pingcap / tiflow

This repo maintains DM (a data migration platform) and TiCDC (change data capture for TiDB)
Apache License 2.0
427 stars 285 forks source link

Add a convenient way to collect the profile info of TiCDC. #7207

Open asddongmen opened 2 years ago

asddongmen commented 2 years ago

Is your feature request related to a problem?

In some oncalls, we need to teach the user how to collect the profile of cdc process, it is painful and time-consuming to do.

Describe the feature you'd like

Add a shell script or other tool to make this thing easier.

Describe alternatives you've considered

No response

Teachability, Documentation, Adoption, Migration Strategy

No response

amyangfei commented 2 years ago

What about adding a debug api, just as what tidb does. ref: https://github.com/pingcap/tidb/blob/master/docs/tidb_http_api.md

Download TiDB debug info

curl http://{TiDBIP}:10080/debug/zip?seconds=60 --output debug.zip
zip file will include:

Go heap pprof(after GC)
Go cpu pprof(10s)
Go mutex pprof
Full goroutine
TiDB config and version
Param:

seconds: profile time(s), default is 10s.
asddongmen commented 2 years ago

yep, it will be good!

What about adding a debug api, just as what tidb does. ref: https://github.com/pingcap/tidb/blob/master/docs/tidb_http_api.md

Download TiDB debug info

curl http://{TiDBIP}:10080/debug/zip?seconds=60 --output debug.zip
zip file will include:

Go heap pprof(after GC)
Go cpu pprof(10s)
Go mutex pprof
Full goroutine
TiDB config and version
Param:

seconds: profile time(s), default is 10s.

Good advise.

asddongmen commented 2 years ago

What about adding a debug api, just as what tidb does. ref: https://github.com/pingcap/tidb/blob/master/docs/tidb_http_api.md

Download TiDB debug info

curl http://{TiDBIP}:10080/debug/zip?seconds=60 --output debug.zip
zip file will include:

Go heap pprof(after GC)
Go cpu pprof(10s)
Go mutex pprof
Full goroutine
TiDB config and version
Param:

seconds: profile time(s), default is 10s.

However, the shell script is also needed for the old cdc version users.