``feat(logic): 添加pprof性能分析支持并调整服务器配置``
This commit is contained in:
@@ -13,10 +13,18 @@ import (
|
||||
"blazing/cool"
|
||||
|
||||
//"blazing/o/service"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
func PprofWeb() {
|
||||
err := http.ListenAndServe(":9909", nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
func signalHandlerForMain(sig os.Signal) {
|
||||
fight.Fightpool.Release()
|
||||
fmt.Println("MainProcess is shutting down due to signal:", sig.String())
|
||||
@@ -29,6 +37,9 @@ func main() {
|
||||
}
|
||||
|
||||
go Start(cool.Config.PortBL) //注入service
|
||||
if cool.Config.PortBL == 1 { //只分析1服务器的
|
||||
go PprofWeb()
|
||||
}
|
||||
|
||||
fmt.Println("Process start, pid:", os.Getpid())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user