diff --git a/main.go b/main.go index 767719fc..53652c6e 100644 --- a/main.go +++ b/main.go @@ -134,6 +134,8 @@ func main() { s.Warnf("Failed to set GOMAXPROCS: %v", err) } else { defer undo() + // Reset these from the snapshots from init for monitor.go + server.SnapshotMonitorInfo() } s.WaitForShutdown() diff --git a/server/monitor.go b/server/monitor.go index 62beb564..d2aadfc6 100644 --- a/server/monitor.go +++ b/server/monitor.go @@ -40,11 +40,15 @@ import ( var numCores int var maxProcs int -func init() { +func SnapshotMonitorInfo() { numCores = runtime.NumCPU() maxProcs = runtime.GOMAXPROCS(0) } +func init() { + SnapshotMonitorInfo() +} + // Connz represents detailed information on current client connections. type Connz struct { ID string `json:"server_id"`