Block profiling tweaks (#11612)

The base profiles contains no valuable data, don't record them.

Reduce block rate by 2 orders of magnitude, should still capture just as valuable data with less CPU strain.
This commit is contained in:
Klaus Post 2021-02-27 09:22:14 -08:00 committed by GitHub
parent b690304eed
commit c5b3a675fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,8 +322,7 @@ func startProfiler(profilerType string) (minioProfiler, error) {
return buf.Bytes(), err return buf.Bytes(), err
} }
case madmin.ProfilerBlock: case madmin.ProfilerBlock:
prof.recordBase("block", 0) runtime.SetBlockProfileRate(100)
runtime.SetBlockProfileRate(1)
prof.stopFn = func() ([]byte, error) { prof.stopFn = func() ([]byte, error) {
var buf bytes.Buffer var buf bytes.Buffer
err := pprof.Lookup("block").WriteTo(&buf, 0) err := pprof.Lookup("block").WriteTo(&buf, 0)