Recommended RAM ratios for ELK with docker-compose

I have a production server with 8GB RAM. Im looking to host elastic,logstash and kibana on the server. Using documer compose.

What would be the recommended java sizes memory sizes for each of the containers. How might I configure this.

My docker-compose looks like the following

---
version: '3'
services

  kibana:
    build:
      context: kibana/
    container_name: kibana
    volumes:
      - ./kibana/config/:/usr/share/kibana/config:ro
    networks: ['elk']
    depends_on:
      - elasticsearch
    restart: always

  elasticsearch:
    build:
      context: elasticsearch/
    container_name: elasticsearch
    networks: ['elk']
    volumes:
      - ./elastic-data:/usr/share/elasticsearch/data
      - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    restart: always
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    environment:
      - cluster.name=es-docker
      - node.name=node1
      - bootstrap.memory_lock=true

  logstash:
      build:
        context: logstash/
      container_name: logstash
      volumes:
        - ./logstash/pipeline/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
      networks: ['elk']
      ports:
        - "5044:5044"
      depends_on:
        - elasticsearch
      restart: always

networks: {elk: {}}

Now searching around on the elastic documentatino im seeting some settings like
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" etc

So what I would like to know.. For the above docker-compose what settings should I allow for java heap sizes / memory limit and how do I update the compose to include it.

My thoughts are
4GB for elastic
2GB for logstash
1GB for Kibana

1GB reserved for host

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