Good morning,
We are facing the problem "Out Of Memory" with elasticsearch.
Our configuration :
We are running on ec2 instance (tg4.micro) with 1gb ram and 1cpu. I know that perhaps it is not sufficient but i want to get more advice.
We are connecting elasticsearch with kibana, logstash and apm to implement application monitoring.
Elasticsearch configuration : (version 7.17)
bootstrap.memory_lock: false
http.port: 9200
network.host: 0.0.0.0
transport.host: localhost
transport.tcp.port: 9300
xpack.security.authc.api_key.enabled: true
#################################### Paths ####################################
# Path to directory containing configuration (this file and logging.yml):
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
action.auto_create_index: true
xpack.security.enabled: true
jvm configuration :
## GC configuration
8-13:-XX:+UseConcMarkSweepGC
8-13:-XX:CMSInitiatingOccupancyFraction=75
8-13:-XX:+UseCMSInitiatingOccupancyOnly
## G1GC Configuration
# NOTE: G1 GC is only supported on JDK version 10 or later
# to use G1GC, uncomment the next two lines and update the version on the
# following three lines to your version of the JDK
# 10-13:-XX:-UseConcMarkSweepGC
# 10-13:-XX:-UseCMSInitiatingOccupancyOnly
14-:-XX:+UseG1GC
## JVM temporary directory
-Djava.io.tmpdir=${ES_TMPDIR}
## heap dumps
# generate a heap dump when an allocation from the Java heap fails
# heap dumps are created in the working directory of the JVM
-XX:+HeapDumpOnOutOfMemoryError
# specify an alternative path for heap dumps; ensure the directory exists and
# has sufficient space
-XX:HeapDumpPath=/var/lib/elasticsearch
# specify an alternative path for JVM fatal error logs
-XX:ErrorFile=/data/elasticsearch/logs/hs_err_pid%p.log
## JDK 8 GC logging
8:-XX:+PrintGCDetails
8:-XX:+PrintGCDateStamps
8:-XX:+PrintTenuringDistribution
8:-XX:+PrintGCApplicationStoppedTime
8:-Xloggc:/data/elasticsearch/logs/gc.log
8:-XX:+UseGCLogFileRotation
8:-XX:NumberOfGCLogFiles=32
8:-XX:GCLogFileSize=64m
# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/data/elasticsearch/logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
The swapping mechanism is disabled using : sudo swapoff -a.
I need some advice about the configuration, what i should improve and add ?