Disable settings that impact performance
Disable the following settings, which can cause issues with performance.
Disable CPU frequency scaling
Recent Linux systems include a feature called CPU frequency scaling or CPU speed scaling. This feature allows a server’s clock speed to be dynamically adjusted so that the server can run at lower clock speeds when the demand or load is low. This change reduces the server’s power consumption and heat output, which significantly impacts cooling costs. Unfortunately, this behavior has a detrimental effect on servers running DSE, because throughput can be capped at a lower rate.
On most Linux systems, a CPUfreq
governor manages the scaling of frequencies based on defined rules.
The default ondemand
governor switches the clock frequency to maximum when demand is high, and switches to the lowest frequency when the system is idle.
Do not use governors that lower the CPU frequency.
To ensure optimal performance, reconfigure all CPUs to use the |
The performance governor will not switch frequencies, which means that power savings will be bypassed to always run at maximum throughput. On most systems, run the following command to set the governor:
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
do
[ -f $CPUFREQ ] || continue
echo -n performance > $CPUFREQ
done
If this directory does not exist on your system, refer to one of the following pages based on your operating system:
For more information, see High server load and latency when CPU frequency scaling is enabled in the DataStax Help Center. |
Disable zone_reclaim_mode on NUMA systems
The Linux kernel can be inconsistent in enabling/disabling zone_reclaim_mode, which can result in odd performance problems.
To ensure that zone_reclaim_mode is disabled:
echo 0 > /proc/sys/vm/zone_reclaim_mode
For more information, see Peculiar Linux kernel performance problem on NUMA systems.
Disable swap
Failure to disable swap entirely can severely lower performance. Because the database has multiple replicas and transparent failover, it is preferable for a replica to be killed immediately when memory is low rather than go into swap. This allows traffic to be immediately redirected to a functioning replica instead of continuing to hit the replica that has high latency due to swapping. If your system has a lot of DRAM, swapping still lowers performance significantly because the OS swaps out executable code so that more DRAM is available for caching disks.
If you insist on using swap, you can set vm.swappiness=1. This allows the kernel swap out the absolute least used parts.
sudo swapoff --all
To make this change permanent, remove all swap file entries from /etc/fstab
.
For more information, see Nodes seem to freeze after some period of time.