Couchbase Tuning
My single node server is running Couchbase 3.0.3-1716 on Centos 6.7 with 40 HW threads (20 cores*2 hw threads each), 32GB Ram and 64GB storage. It can currently reach max throughput of 200K ops/sec. With 1 client machine, it can reach 120K ops per sec. Using 2 client machines, it can reach 200K ops/sec. But when I use 3 or more machines, it can never go beyond 200K ops/sec.
Below are the sysctl configurations I have tried
Config 1:
vm.swappiness = 0
vm.dirty_background_ratio = 10
vm.dirty_ratio = 20
vm.dirty_writeback_centisecs = 100
vm.dirty_expire_centisecs = 200
net.ipv4.tcp_sack = 0
net.ipv4.tcp_fack = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_intvl = 30
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_mem = 134217728 134217728 134217728
net.ipv4.tcp_rmem = 4096 277750 134217728
net.ipv4.tcp_wmem = 4096 277750 134217728
net.core.somaxconn = 40000
net.core.netdev_max_backlog = 300000
net.ipv4.tcp_max_syn_backlog = 40000
Config 2:
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_workaround_signed_windows=1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_low_latency = 1
net.ipv4.ip_no_pmtu_disc = 0
net.ipv4.tcp_mtu_probing = 1
fs.file-max = 50384
net.core.netdev_max_backlog = 300000
net.ipv4.tcp_moderate_rcvbuf = 1
net.core.somaxconn = 40000
net.ipv4.tcp_max_syn_backlog = 40000
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_tw_reuse = 1
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.core.optmem_max = 134217728
net.ipv4.tcp_mem = 134217728 134217728 134217728
net.ipv4.tcp_rmem = 4096 262144 134217728
net.ipv4.tcp_wmem = 4096 262144 134217728
vm.swappiness = 0
vm.dirty_bytes = 209715200
vm.dirty_background_bytes = 104857600
vm.zone_reclaim_mode = 0
My common settings are below
ext4 filesystem with options rw,noatime,barrier=0,data=writeback
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo deadline > /sys/block/sda/queue/scheduler
echo 1024 > /sys/block/sda/queue/nr_requests
selinux disabled
ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 999999
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) unlimited
real-time priority (-r) 0
stack size (kbytes, -s) 244
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
None of the configurations has gone beyond 200K ops/sec. My total CPU usage has never gone beyond 15%. My CPU distribution was okay as none reached more than 40%. My total RAM usage was just less than 10%. My disk usage was just 5%.
What else am I missing? Why cant I make it go beyond that 200K ops/sec limit while none of my HW limits is being reached yet? Please help as we really want to utilise each machine in the cluster.
Thanks in advance!