Liferay Enterprise Search

[LES] What is the recommended Java heap size for Elasticsearch?

Question

What is the recommended Java heap size for Elasticsearch?

Answer

It depends on what you will be doing. If you use faceting, aggregations, or parent/child queries you will need more heap space. It might make sense to run some performance tests and monitor the heap to figure out what a good heap size would be.

Regardless, we do not recommend setting heap larger than 30.5GB and not more than half available memory, whichever is lower. (e.g. 128GB of available memory = max 30.5GB heap, 64GB of available memory = max 30.5GB heap, 32GB of available memory = max 16GB heap). This upper limit is required to ensure the underlying Lucene software can make use of compressed pointers, which offer a major performance gain.

If you see this in your logs:

[INFO ][o.e.e.NodeEnvironment ] [node01] heap size [30.5gb], compressed ordinary object pointers [true]

then compressed object pointers are being used: good.

But if you see this

[INFO ][o.e.e.NodeEnvironment ] [node01] heap size [35.0gb], compressed ordinary object pointers [false]

then long pointers are being used, and it would be more efficient to reduce the amount of memory given to the elasticsearch heap.

Please, also refer to the following articles for details:


Elastic, Elasticsearch, and X-Pack are trademarks of Elasticsearch BV, registered in the U.S. and in other countries.

On this page