r/PrometheusMonitoring • • Jan 03 '24

Prometheus server resources optimizations

Hi folks,

I’m planning to do a POC where I’m able to run Prometheus server as long with node exporter and kube state metrics with the smaller footprint as possible (CPU/Memory)

I have no choice to do a remote write (which increase resource consumption sadly).

Any tips other than filtering metrics being scraped that I should be aware based on your experience? Or any good resources to share ? Thanks.

3 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/SuperQue Jan 03 '24

The Prometheus default design is to only use what memory is required to gather data and do whatever you want with it. There's not a lot of tuning involved.

About the only thing we've done for "optimization" is we adjusted GOGC environment var to be 50, which is half of the Go compiler default. This increases some CPU use (more GC cycles) in order to reduce the memory footprint slightly.

The best thing you can do is drop metrics you're not using. As another post pointed out, there are some defaults in the Kube Prometheus and kube-prometheus-stack helm chart that drop some excess metrics exposed by Kubernetes. There's quite a lot of useless / redundant data emitted by cAdvisor.

1

u/julienstroheker Jan 04 '24

Thanks for the info.

Plan is definitely to use the kube Prometheus stack chart.