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.
I want to assign 4G to Elasticsearch and 4G to MySQL. We know that in Elasticsearch :
As a rule of the thumb, the maximum heap size should be set up to 50% of your RAM,
Question No.1 :
I don't know, I need to set the min and max JVM heap size, to 4G or 2G in this case which we have 8G memory shared with MySQL?
-Xms4g
-Xmx4g
Or :
-Xms2g
-Xmx2g
Another configuration: 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 No.2:
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
question from:
https://stackoverflow.com/questions/65950194/elasticsearch-configuration-in-a-shared-server 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…