Example sysctl.conf file

The following example of a sysctl.conf file shows settings that have been used in testing.

/etc/sysctl.conf

Tip: Optimize Cassandra and ElasticSearch Kernel parameters by either disabling Swap, or setting the Kernel vm.swappiness parameter to 1.
To customize your sysctl.conf file, first back-up the original file, then edit it, before restarting the system. The default location is /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.

vm.swappiness = 1
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100

kernel.shmmax = 4398046511104
kernel.shmall = 1073741824

kernel.sem = 250 256000 100 16384

net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

fs.aio-max-nr = 1048576

kernel.panic_on_oops = 1

fs.file-max = 6815744

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_syncookies = 1

net.core.somaxconn = 1024

kernel.shmmni = 16384

net.ipv4.ip_local_port_range = 9000 65535

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.shmmax = 540971653120

kernel.shmall = 4294967296