Article Directory
Keywords: memory lock open lock closed memory performance optimization Elasticsearch nodes bootstarp memory lock
1. Check Elasticsearch memory locked state
The system default for memory exchange, this will lead to Elasticsearch poor performance.
We can view the memory locked, any host access http: // ip: port / _nodes filter_path = ** mlockall, available?.
"nodes": {
"73BQvOC2TpSXcr-IXBcDdg": {
"process": {
"mlockall": false
}
},
"9tRr4nFDT_2rErLLQB2dIQ": {
"process": {
"mlockall": false
}
},
We can see, memory does not open the lock, we need to open the locked memory physical address.
2. Open Elasticsearch memory lock function
2.1 pairs config / elasticsearch.yml configuration file for each host to modify Elasticsearch
bootstrap.memory_lock: true
2.2 modify /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 32000
* hard nproc 32000
* hard memlock unlimited
* soft memlock unlimited
2.3 modify /etc/systemd/system.conf
DefaultLimitNOFILE=65536
DefaultLimitNPROC=32000
DefaultLimitMEMLOCK=infinity
3. Restart Elasticsearch, valid configuration
Check again http: // ip:?. Port / _nodes filter_path = ** mlockall, have been found to successfully open, solve some performance problems.
Reference Documents
1. Turn the memory lock https://cloud.tencent.com/developer/article/1189282
2. Memory lock error Detailed https://segmentfault.com/a/1190000014891856