Elasticsearch configuration in a shared server/node

I do know it's better to have separate server for each job, but I have a shared server between Elasticsearch and MySQL, with a total 8 Gig RAM.

we should avoid swapping in Elasticsearch, so I set bootstrap.memory_lock: true , and I need to set/uncomment MAX_LOCKED_MEMORY=unlimited in file /etc/default/elasticsearch .

Question : Do I have to set this to unlimited while we know that only 4G must be assigned to Elasticsearch? How do I set MAX_LOCKED_MEMORY to 4G for example and not to unlimited? cause I have 8G shared memory between Elasticsearch and MySQL, and is this true in this case to set it to 4G instead of unlimited? If not, what's the best configuration? I think it should be something like this maybe:

MAX_LOCKED_MEMORY= 4G

Hi @ehsan_kabiri_33 ,

the best configuration is unlimited, also for a shared host. It can be a bit problematic to calculate the precise amount of memory, since this easily changes with java versions etc. So the easier route is to just allow unlimited. Notice that this does not mean that Elasticsearch will memory lock unlimited, only that it is allowed to.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.