I am in the process of going from dev to a production model of the Elastic stack with docker compose. I have a few newbie questions about java mem and heap sizes. The docker host box has a total of 24gb of ram. In my docker compose file each elastic node is set to
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
Do I need to set each node to only use a percentage of the box? Also is there any guidelines as to what to leave left over for the host machine? Should I give each node 6gb or ram and leave the host machine 6gb?
Also in the docker-compose.yml, each node has ulimts set. I am a little confused by the documentation as to what these need to be in production. Currently, they are set at mem_limit 1g. Should this value reflect the total ram in the host machine? (mem_limit: 24gb)
Full docker-compose.yml
version: '2'
services:
elasticsearch1:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.4
container_name: elasticsearch1
environment:
- cluster.name=SASD-Docker-Cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
volumes:
- esdata1:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- esnet
elasticsearch2:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.4
container_name: elasticsearch2
environment:
- cluster.name=SASD-Docker-Cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch1, elasticsearch3"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
volumes:
- esdata2:/usr/share/elasticsearch/data
networks:
- esnet
elasticsearch3:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.4
container_name: elasticsearch3
environment:
- cluster.name=SASD-Docker-Cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "discovery.zen.ping.unicast.hosts=elasticsearch1, elasticsearch2"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
volumes:
- esdata2:/usr/share/elasticsearch/data
networks:
- esnet
kibana:
image: docker.elastic.co/kibana/kibana:5.6.4
environment:
SERVER_NAME: s50-kibana.company.com
ELASTICSEARCH_URL: http://elasticsearch1:9200
ELASTICSEARCH_USERNAME: elastic
ELASTICSEARCH_PASSWORD: changeme
ports:
- "5601:5601"
networks:
- esnet
logstash:
image: docker.elastic.co/logstash/logstash:5.6.4
environment:
- JAVA_OPTS=-Xms1g -Xmx1g
- XPACK_MONITORING_ENABLED=false
volumes:
- /home/ncssdocker/pipeline/:/usr/share/logstash/pipeline/
command: logstash -f /usr/share/logstash/pipeline/FiresightKV.conf
ports:
- "5000:5000/udp"
networks:
- esnet
depends_on:
- elasticsearch1
volumes:
esdata1:
driver: local
esdata2:
driver: local
networks:
esnet: