# High memory usage of Metricbeat in Kubernetes

**URL:** <https://discuss.elastic.co/t/high-memory-usage-of-metricbeat-in-kubernetes/301961>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 8, 2022, 11:22am UTC](https://discuss.elastic.co/t/high-memory-usage-of-metricbeat-in-kubernetes/301961 "2022-04-08T11:22:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![melkamar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/melkamar/32/100785_2.png) [@melkamar](https://discuss.elastic.co/u/melkamar)\
**Post date:** [April 8, 2022, 11:22am UTC](https://discuss.elastic.co/t/high-memory-usage-of-metricbeat-in-kubernetes/301961/1 "2022-04-08T11:22:51Z")

</div>

I am trying out collecting metrics and logs from pods in our staging Kubernetes cluster. I have followed the instructions here: [Run Metricbeat on Kubernetes | Metricbeat Reference [8.1] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/running-on-kubernetes.html)

The cluster has two nodes and 269 running pods. There is a metricbeat pod on each of the two nodes and each eats up about 250 MB of memory, which seems a bit too much to me. When running metricbeat on a server without containerization, the memory footprint is barely 50 MB.

Also, the default Kubernetes manifests provided by Elastic declare `resources.limits.memory: 200Mi` which made the pods OOMKilled until I raised that limit myself, so that suggests to me something is off.

Is such a high memory usage to be expected? If so, is there any ways to optimize? (E.g. only collect metrics from some pods - determined by labels, annotations etc).

Using version 7.16.3. Thanks!

---

<div class="post-metadata">

**Author:** ![cocuba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cocuba/32/104502_2.png) [@cocuba](https://discuss.elastic.co/u/cocuba)\
**Post date:** [April 18, 2022, 9:52pm UTC](https://discuss.elastic.co/t/high-memory-usage-of-metricbeat-in-kubernetes/301961/2 "2022-04-18T21:52:10Z")

</div>

hi, how did you solve this? thanks in advance

---

<div class="post-metadata">

**Author:** ![melkamar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/melkamar/32/100785_2.png) [@melkamar](https://discuss.elastic.co/u/melkamar)\
**Post date:** [April 20, 2022, 7:05am UTC](https://discuss.elastic.co/t/high-memory-usage-of-metricbeat-in-kubernetes/301961/3 "2022-04-20T07:05:16Z")

</div>

I did not, still waiting for suggestions.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 18, 2022, 9:06am UTC](https://discuss.elastic.co/t/high-memory-usage-of-metricbeat-in-kubernetes/301961/4 "2022-05-18T09:06:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
