Merge pull request #6486 from ipfs/fix/6457

document the debug script
This commit is contained in:
Steven Allen 2019-07-08 09:07:27 -07:00 committed by GitHub
commit c014d1ee01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -8,6 +8,11 @@ tmpdir=$(mktemp -d)
export PPROF_TMPDIR="$tmpdir"
pushd "$tmpdir"
IPFS_BIN=$(which ipfs)
if [[ -e "$IPFS_BIN" ]]; then
cp "$IPFS_BIN" ipfs
fi
echo Collecting goroutine stacks
curl -o goroutines.stacks "http://$HTTP_API"'/debug/pprof/goroutine?debug=2'

View File

@ -15,6 +15,11 @@ When you see ipfs doing something (using lots of CPU, memory, or otherwise
being weird), the first thing you want to do is gather all the relevant
profiling information.
There's a script (`bin/collect-profiles.sh`) that will do this for you and
bundle the results up into a tarball, ready to be attached to a bug report.
If you feel intrepid, you can dump this information and investigate it yourself:
- goroutine dump
- `curl localhost:5001/debug/pprof/goroutine\?debug=2 > ipfs.stacks`
- 30 second cpu profile
@ -26,10 +31,6 @@ profiling information.
- system information
- `ipfs diag sys > ipfs.sysinfo`
Bundle all that up and include a copy of the ipfs binary that you are running
(having the exact same binary is important, it contains debug info).
You can investigate yourself if you feel intrepid:
### Analyzing the stack dump