'Best practices on limiting memory usage of Elasticsearch for local development environment
I have a Ruby on Rails app for which I use Docker Compose to develop locally. I always use a copy of our production PostgreSQL database which is pretty large with around 500,000 rows. A lot of that data gets indexed for search in Elasticsearch using the Searchkick gem. I want to reproduce the production environment as closely as possible but I'm getting slowed down by the huge RAM usage of Elasticsearch on my laptop. I'm getting over 10GB of RAM usage often.
Has anyone thought of a solution for limiting the RAM usage of Elasticsearch just for local development?
Here are the Elasticsearch settings in my docker-compose.yml file:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.1
environment:
- "discovery.type=single-node"
- "ELASTIC_USERNAME=elastic"
- "ELASTIC_PASSWORD=DkIedPPSCb"
- "xpack.security.enabled=true"
ports: ['9200:9200', '9300:9300']
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|