saucelabs / forwarder

Forwarder is a production-ready, fast MITM proxy with PAC support. It's suitable for debugging, intercepting and manipulating HTTP traffic. It's used as a core component of Sauce Labs Sauce Connect Proxy.
https://forwarder-proxy.io
Mozilla Public License 2.0
221 stars 13 forks source link

promhttp allocates a lot of memory for gzip #659

Closed mmatczuk closed 7 months ago

mmatczuk commented 7 months ago

Monitoring allocates almost 10% of my MITM test workflow.

image
mmatczuk commented 7 months ago

Disable compression and enable OpenMetrics

mmatczuk commented 7 months ago

https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/promhttp#HandlerOpts

mmatczuk commented 7 months ago

This reduced the allocations to 8MB.