parca icon indicating copy to clipboard operation
parca copied to clipboard

Start http listener before opening the DB

Open bboreham opened this issue 5 years ago • 4 comments

I restarted conprof and it has been silent for 25 minutes; if it was listening on /debug/pprof I could find out what it is doing. Also it should respond to /metrics.

bboreham avatar Nov 29 '19 14:11 bboreham

Agreed. We should start the http server basically immediately.

brancz avatar Dec 03 '19 13:12 brancz

I just looked at our code again and this might be harder to do than I hoped for (but already feared). Due to all handlers being added to the same listener and mux the API handlers are blocking on the TSDB being opened...

We might need to refactor and start using internal handlers so we can start metrics, pprof etc independently from the actual app. I still need to check how Thanos does it though.

metalmatze avatar Apr 16 '21 18:04 metalmatze

Maybe we can move the tsdb opening into a tsdb-opener function that we just pass and not block on.

brancz avatar Apr 18 '21 09:04 brancz

In prometheus we use readyStorage for this, in the main cmd/prometheus package.

We also open the tcp socket early and do a first read of the configuration early after the start, all that to fail fast.

roidelapluie avatar Apr 18 '21 09:04 roidelapluie