Mlockall or vmswappiness on CentOs

What is the difference between "bootstrap.mlockall: true" and vm.swappiness=1.

Basically mlockall involves more works to do such as

  • Setting memlock as unlimited in /etc/security/limits.conf
  • jna issues

Rather vm.swappiness=1 or vm.swappiness=0 seems single straight forward solution. Assuming vm.swappiness only stop anonymous pages being swapped and OS swaps file backed pages if needed. (If not please correct me !)

Please any idea on this ?

@jprante Please share your thoughts on this.

vm.swappiness when set to 0 only allow swaps in emergency conditions. Please refer: http://askubuntu.com/questions/103915/how-do-i-configure-swappiness & https://www.elastic.co/guide/en/elasticsearch/reference/2.1/setup-configuration.html

whereas, mlockall when set to true locks the process address space in RAM preventing any es memory from swapping out.

So, mlockall will allow swaping other than es process but swappiness will not allow swaps at all unless its an emergency condition.

1 Like

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