2

My elasticsearch service is consuming around 1 gb.

My total memory is 2gb. The elasticsearch service keeps getting shut down. I guess the reason is because of the high memory consumption. How can i limit the usage to just 512 MB?

This is the memory before starting elastic search

enter image description here

After running sudo service elasticsearch start the memory consumption jumps

enter image description here

I appreciate any help! Thanks!

Community
  • 1
  • 1
kofhearts
  • 3,607
  • 8
  • 46
  • 79

1 Answers1

1

From the official doc

The default installation of Elasticsearch is configured with a 1 GB heap. For just about every deployment, this number is usually too small. If you are using the default heap values, your cluster is probably configured incorrectly.

So you can change it like this

There are two ways to change the heap size in Elasticsearch. The easiest is to set an environment variable called ES_HEAP_SIZE. When the server process starts, it will read this environment variable and set the heap accordingly. As an example, you can set it via the command line as follows: export ES_HEAP_SIZE=512m

But it's not recommended. You just can't run an Elasticsearch in the optimal way with so few RAM available.

Pierre Mallet
  • 7,053
  • 2
  • 19
  • 30