``feat(logic): 添加pprof性能分析支持并调整服务器配置``

This commit is contained in:
1
2025-10-15 15:54:35 +00:00
parent 241cef544c
commit bee6291a12
3 changed files with 13 additions and 1 deletions

1
.gitignore vendored
View File

@@ -33,3 +33,4 @@ logic/logic_linux_amd64
login/login_linux_amd64
logic/logic
.gitignore
public/logic

View File

@@ -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())

View File

@@ -1,6 +1,6 @@
server:
name: "blazing server"
address: ":59480" #前台服务器地址
address: ":8080" #前台服务器地址
port: 53388 #后台服务器端口
rpc: 56409 #rpc服务端口
game: [55407,50876,52482]