What are the resource requirements to run Logstash in a k8s pod?

10/24/2020

I was noticing that running a ELK stack on a Raspberry Pi running a Kubernetes Cluster. I noticed that it didnt have the resources to run all three containers. I was looking up that with Kubernetes you can put limits and requests on your resources CPU and Memory, and it got me thinking. What are the minimum requirements? To me, applications are greedy, so is there a way to cut down the requirements for Logstash, to emphasize resources for Elasticsearch?

Right now, I am running a Raspberry Pi 4, 4g RAM, 32G disk.

If I can put min and max requirements on the container it will better allow me manage the resources. The think though that I noticed is that there was no insight from what I can tell as to minimum requirements for the different containers.

https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-managing-compute-resources.html

The above link i believe tells me that the CPU consumption is greedy, but the default MEMORY for Elastic and Kibana 2Gi and 1Gi respectively. It mentioned nothing about logstash though, and whether or not there is a Minimum requirement for CPUs.

I wasnt sure if I should set each ELK container to 1CPU, 1Gi RAM, and I can try it to see if it functions, but since the concept of it throttling down makes me curious what the happy medium would be.

-- Fallenreaper
elasticsearch
kubernetes
logstash

1 Answer

10/24/2020

Logstash is not part of the Elastic Cloud, that is why there is no mention of it in the Elastic Cloud on Kubernetes documentation link that you shared.

Logstash is way more CPU bound than memory bound, but how much memory does it needs is completely dependent on your pipelines.

In Logstash the memory depends on the pipelines, the batch size, the filters used, the number of events per seconds, the queue type etc. If you are running a dev or lab environment I think that you can try to give Logstash 1 CPU and 512 MB of RAM and see if it feets your use case.

But I would say that 4GB is pretty small for a full stack since you need to have memory for the applications and still have some memory left for the sytems.

-- leandrojmp
Source: StackOverflow