From d7eec1edd4c75d9a2cb616a69a746f328110faab Mon Sep 17 00:00:00 2001 From: Ben Werthmann Date: Wed, 1 Dec 2021 16:03:23 -0500 Subject: [PATCH] [CHANGED] Profiler: Start profile_port earlier Enables use of pprof to investigate server startup. Co-authored-by: Ivan Kozlovic Signed-off-by: Ben Werthmann --- server/server.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/server.go b/server/server.go index 54ad808c..8537206f 100644 --- a/server/server.go +++ b/server/server.go @@ -1541,6 +1541,11 @@ func (s *Server) Start() { s.grRunning = true s.grMu.Unlock() + // Pprof http endpoint for the profiler. + if opts.ProfPort != 0 { + s.StartProfiler() + } + if opts.ConfigFile != _EMPTY_ { s.Noticef("Using configuration file: %s", opts.ConfigFile) } @@ -1740,11 +1745,6 @@ func (s *Server) Start() { }) } - // Pprof http endpoint for the profiler. - if opts.ProfPort != 0 { - s.StartProfiler() - } - if opts.PortsFileDir != _EMPTY_ { s.logPorts() }