I have an EC2 instance having 32 GB RAM and I am using Django Elasticsearch DSL to use elastic search in Django for searching in Model objects. I have containerized the elastic search server.
Below is the code from the docker YAML file to build the image.
elasticsearch:
image: elasticsearch:7.12.1
container_name: zinia-backend-elasticsearch
ports:
- "9300:9300"
- "9200:9200"
environment:
discovery.type: "single-node"
restart: unless-stopped
networks:
- backend
But currently, I am facing the issue of high memory consumption by elastic search it is taking up to 16.5 GB of memory, and when other containers need more ram the system runs out of memory and stops responding and this becomes a critical issue for our team and project. Please, someone guide the way to control it.
Thanks in advance.