mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
enhance: enable profile and block profiling (#34642)
fix #34641 Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
This commit is contained in:
parent
a11714913b
commit
7eaef09ba5
@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@ -151,6 +152,10 @@ func ServeHTTP() {
|
||||
bindAddr := getHTTPAddr()
|
||||
log.Info("management listen", zap.String("addr", bindAddr))
|
||||
server = &http.Server{Handler: metricsServer, Addr: bindAddr, ReadTimeout: 10 * time.Second}
|
||||
// enable mutex && block profile, sampling rate 10%
|
||||
runtime.SetMutexProfileFraction(10)
|
||||
runtime.SetBlockProfileRate(10)
|
||||
|
||||
if err := server.ListenAndServe(); err != nil {
|
||||
log.Error("handle metrics failed", zap.Error(err))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user