Database Reference
In-Depth Information
though the reads and writes as a result of the queries aren't normally sequential,
they will likely be concurrent. This usage of dd mimics the concurrency aspect of
the load.
Virtual Memory and Swap
If you are running Cassandra on a dedicated machine, the suggested swap setting
is to keep it off. The ideal case in a bad scenario with regard to memory is that the
OS kills off the Java process running Cassandra, leaving the OS reachable even if
Cassandra is down. If the machine is allowed to swap itself “to death,” you will
have no way to get to the machine to fix it.
The settings in Linux that control these are swappiness , overcom-
mit_memory , and overcommit_ratio . In the preceding scenario, over-
commit_memory should be set to 2 and swappiness should be set to 0. An
overcommit_memory setting of 2 will ensure that Linux will not hand out an-
onymous pages of memory unless it is sure it has a place to store them in physical
memory (RAM). A swappiness setting of 0 tells the kernel to avoid swapping
processes out of physical memory for as long as possible.
By default, Linux attempts to be smart and limits the maximum number of
memory map areas that a process may have. Most applications don't need many
maps. Since Cassandra works a lot with memory, it is a good idea to give it a little
bit of headroom. The default for this setting is 65,535 maps. While this is fine most
of the time, setting it to something higher is a good idea. A safe value for a high-
volume machine and one that is commonly used on Cassandra nodes is 262,140,
or four times the default setting.
sysctl Network Settings
There are a few other sysctl settings that can be adjusted for getting more per-
formance out of your Cassandra machine. They are relevant to the amount of net-
work traffic that is allowed in and out of the node. Listing 6.6 shows changes to the
send and receive buffer sizes to tell the Linux kernel to allow for higher through-
put of network traffic.
Listing 6.6 sysctl Settings to Allow for Higher Throughput of Network
Traffic
Click here to view code image
 
Search WWH ::




Custom Search