Monday, April 18, 2016

Cassandra : Unable to lock JVM memory (ENOMEM)

Overview:
This article will describe one of the errors you might notice in Upsource logs. 
Symptoms: 
Upsource continuously shows "Indexing in progress" for some (all) revisions or Apache Cassandra database gets restarted on a regular basis. Going through Upsource logs you find this error: 
Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out, especially with mmapped I/O enabled. Increase RLIMIT_MEMLOCK or run Cassandra as root.
Solution:
Insufficient resource limits may result in this kind of error. To prevent that, we recommend to set:
  • maximum open files to 100000
  • memory locking and address space limit to unlimited.
  • number of processes to 32768
You can do it by adding the following lines to the /etc/security/limits.conf file:

* - memlock unlimited
* - nofile 100000
* - nproc 32768
* - as unlimited

No comments:

Post a Comment