From f906f3397fb9d182ed588e7354a4829798fece42 Mon Sep 17 00:00:00 2001 From: jspc Date: Wed, 3 Jan 2024 20:21:51 +0000 Subject: [PATCH] Bake in pprof data from production to optimise hot paths This data was collected by setting `COLLECT_METRICS=yes` on production and then running: ```bash $ while true; do curl http://localhost:6060/debug/pprof/profile?seconds=30 --output profiles/$(date +%s).pprof; sleep 270; done ``` To gather a chunk of metrics every 5 mins for 30 seconds for a couple of hours. The traffic to the server came in bursts, but included lots of visits to jupyter- which is massively asset heavy and makes loads of calls to /api/v1/auth. At some point we can start thinking about gathering data from loads of instances over many days with lots of requests; at that point this commit will be useful prep --- .gitignore | 1 + Makefile | 2 +- merged.pprof | Bin 0 -> 4245 bytes pgo.go | 16 ++++++++++++++++ profiles/.gitkeep | 0 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 merged.pprof create mode 100644 pgo.go create mode 100644 profiles/.gitkeep diff --git a/.gitignore b/.gitignore index 578eac6..813e515 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ littleauth +profiles/*.pprof diff --git a/Makefile b/Makefile index 1a03083..763076a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -go_build_cmd ?= CGO_ENABLED=1 go build -ldflags="-s -w" -trimpath -race +go_build_cmd ?= CGO_ENABLED=1 go build -ldflags="-s -w" -trimpath -race -pgo merged.pprof littleauth: *.go go.* $(go_build_cmd) -o $@ diff --git a/merged.pprof b/merged.pprof new file mode 100644 index 0000000000000000000000000000000000000000..dc345230d6d8b6e6a62e65f708dd6c862f5c2f11 GIT binary patch literal 4245 zcmV;G5NhuqiwFP!00000|BP9CcogNi@8&{2cCwo{Aqg+xHVn7P5O%XeNFdxV2?^Jj z1W>%JliA7c!tTsEGn)jhr{Q7|L9K1oR;oR%R>gWLw)Jw<$~i?qv?@id+UK;|2Tw1@ z+Md=HIilx0@9ZTT5(0nC{=V<`-rw*0UWmJZxggJ7!1AG>Y^>Ys%F8b(996_dySZYI z7hKT)*zX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