Database Reference
In-Depth Information
Swapping memory
Swap is bad for Cassandra, especially in the production setup. It is advisable to disable
swap on a production machine (assuming it's a dedicated Cassandra server). Basically,
swap space is an area on the secondary storage (hard drive) that works as extended
memory. Swap is used when the total memory required by processes is more than the avail-
able memory. The operating system moves memory segments (also known as pages ) from
or to the swap area to free up memory. This is called paging . Reading from secondary stor-
age to access these pages is painfully slow when compared to access from the main
memory. This is a major performance hit. (More information on paging performance is
available at http://en.wikipedia.org/wiki/Paging#Performance . )
Cassandra is fault tolerant, so we can trade the possibility of a node going down for a
speedy response when it is up. That is a quick node death caused by the Out-Of-Memory
( OOM ) killer resulting from memory crunch, which is better than a sluggish system.
To disable swap permanently, you need to edit /etc/fstab (requires root access) and
comment out all the lines containing the type swap by putting # at the beginning of the
line, as shown in the following line of code:
#/dev/sda3 none swap sw 0 0
To immediately and/or temporarily switch off swap , execute the following command:
$ sudo swapoff --all
Search WWH ::




Custom Search