According to the official documentation, the installation of JNA can improve the memory usage performance of Cassandra, and on Linux it does not need to put JVM memory on the swap partition to prevent related performance issues.
Cassandra 2.0.9 requires JNA 3.2.7 or more, it is recommended to download the installation directly without Yum.
1. Download Jna.jar wget Https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar
2, put Jna.jar to Classpath
3, modify the/etc/security/limits.conf
123 |
vi /etc/security/limits. confCassandra soft memlock Unlimited Cassandra hard memlock unlimited |
Note: Cassandra This user name is the one we use later to start Cassandra. If none of the above statements will prompt such a warning:
1 |
WARN 21st:16:33,064 UnableTo LockJvmMemory (Enomem). This AaResultInch Partof the JVM being swapped out, especially with mmapped i/o Enabled. increase rlimit_memlock or run cassandra as< Span class= "crayon-h" > root |
4, verify whether the installation is successful through our installation in the "Cassandra 2.x Chinese Course (2): Perform simple CQL operation" article installed in the environment can be seen, if you do not install JNA, then start with such a hint
1 |
INFO :827 JNA not found. Native methods'll be disabled. |
After installing JNA, this is a hint.
1 |
INFO :076 JNA mlockall successful |
5, for the production environment of the configuration of the official recommendations are as follows
12345678910111213141516 |
vi /etc/security/limits. conf Cassandra - memlock Unlimited Cassandra - nofile 100000 Cassandra - nproc 32768 Cassandra -as Unlimited vi /etc/security/limits. D/+-nproc. conf Cassandra - nproc 32768 vi /etc/sysctl. conf VMs. Max_map_count = 131072 sysctl -p Swapoff -- All |
Important!!! Sync time
Reference: Cassandra2.0 official documentation.
Initial optimization of performance