Recommended Production Settings for Cassandra on CentOS 6

Posted on by J. Mays | Updated:
Reading Time: 2 minutes

If you’ve already followed the tutorial on How To Install Cassandra on CentOS 6, then you’re ready for another step!

Pre-Flight Check
  • These instructions are intended for Cassandra 2 on a single CentOS 6 server.
  • I’ll be working from a Liquid Web Core Managed CentOS 6.4 server, and I’ll be logged in as root.

A Bit of Cassandra Optimization

For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor

Set nproc limits:

vim /etc/security/limits.d/90-nproc.conf

Add the following line to the bottom of the file, using i to insert:

* - nproc 32768

Your file should now look very similar to this:

Recommended Production Settings for Cassandra on CentOS 6 - 01a

You can either match the spacing of the 90-nproc.conf , or simply enter the above line exactly as it appears. Then exit and save the file with the command :wq .

Next, we’ll edit the sysctl.conf :

vim /etc/sysctl.conf

Add the following line to the bottom of the file, using i to insert:

# Recommended Production Setting for Cassandra
vm.max_map_count = 131072

Your file should now look very similar to this:

Recommended Production Settings for Cassandra on CentOS 6 - 02b

Then exit and save the file with the command :wq .

So the changes take effect, issue the following command or reboot the server:

sysctl -p

Now we’re going to turn-off swap. This can be done with the following command:

swapoff --all

Then, we’ll entirely disable swap by removing all swap entries from /etc/fstab:

vim /etc/fstab

If you’re using a Liquid Web CentOS 6 Core Managed image then you’ll remove this line using dd :

LABEL=SWAP-vda2 swap swap defaults 0 0

Your file should now look very similar to this before removing the above line:

Recommended Production Settings for Cassandra on CentOS 6 - 03a

Exit and save the file with the command :wq . Done!

Avatar for J. Mays

About the Author: J. Mays

As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!

Latest Articles

How to install PyTorch on Linux (AlmaLinux)

Read Article

Innovative armor — exploring ThreatDown’s impact on cyber defense

Read Article

Controlling PHP settings with a custom php.ini file

Read Article

Linux dos2unix command syntax — removing hidden Windows characters from files

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article