Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tuning Couchbase Server, the OS, and the Network for Maximum Performance: Couchbase Connect 2015

4,995 views

Published on

This session will provide an overview of Couchbase performance considerations and actionable information to get the most out of your Couchbase cluster. While some consider tuning a magical black art, you’ll learn the key areas you need to concentrate your efforts to squeeze the most performance out of Couchbase.

Published in: Technology
  • Be the first to comment

Tuning Couchbase Server, the OS, and the Network for Maximum Performance: Couchbase Connect 2015

  1. 1. PERFORMANCETUNING: THE OS, NETWORK, AND COUCHBASE SERVER Dean Proctor, Couchbase
  2. 2. ©2015 Couchbase Inc. 2 Why do we tune?
  3. 3. Operating SystemTuning
  4. 4. ©2015 Couchbase Inc. 4 Virtual Memory Architecture Virtual Memory Swapper OOM Killer Physical Memory Disk Swap Space
  5. 5. ©2015 Couchbase Inc. 5 Memory Allocation  Swap  vm.swapiness=[0,1]  Transparent Huge Pages (THP)  grub.conf: transparent_hugepage=never  echo never > /sys/kernel/mm/transparent_hugepage/enabled  echo never > /sys/kernel/mm/transparent_hugepage/defrag
  6. 6. ©2015 Couchbase Inc. 6 NUMA Architecture CPU Socket 1 DIMM 1 DIMM 3 CPU Socket 2 DIMM 2 DIMM 4 QPI
  7. 7. ©2015 Couchbase Inc. 7 NUMA Architecture CPU Socket 1 DIMM 1 DIMM 3 CPU Socket 2 DIMM 2 DIMM 4 QPI Node0 Node1
  8. 8. ©2015 Couchbase Inc. 8 Disable NUMA  Disable in BIOS  Disable forCouchbase  Init script: numactl –interleave all $DAEMON  vm.zone_reclaim_mode=0
  9. 9. ©2015 Couchbase Inc. 9 Linux Storage Architecture Physical Block Cache VFS
  10. 10. ©2015 Couchbase Inc. 10 Linux Storage Architecture Physical Type Allocation RAID Block Scheduler IO Request Queue Cache Allocation Flush Frequency VFS FSType Mount options
  11. 11. ©2015 Couchbase Inc. 11 VFSTuning  FilesystemType  EXT4  XFS  Mount options  EXT4: noatime,barrier=0,data=writeback  XFS: noatime,nobarrier,logbufs=8,logbsize=256k,allocsize=2M
  12. 12. ©2015 Couchbase Inc. 12 Page Cache  Set the limit for dirty bytes in the page cache  vm.dirty_bytes  vm.dirty_background_bytes  Set the max time for dirty pages  vm.dirty_expire_centisecs  vm.dirty_writeback_centisecs  TuneVFS cache reclaim  vfs_cache_pressure
  13. 13. ©2015 Couchbase Inc. 13 Scheduler  Scheduler algorithm  echo deadline > /sys/block/<dev>/queue/scheduler  IO request queue  echo 1024 > /sys/block/<dev>/queue/nr_requests
  14. 14. ©2015 Couchbase Inc. 14 Physical Devices  Use local storage, 10k+ SATA or SSD  Provision separate disks for data and indexes  Battery-backed RAID  Align your IO!
  15. 15. NetworkTuning
  16. 16. ©2015 Couchbase Inc. 16 Network Architecture NIC TX Ring TX Queue TX Socket Buffer RX Socket Buffer NIC RX Ring RX Queue
  17. 17. ©2015 Couchbase Inc. 17 Resilience  Buffers  net.core.rmem_max  net.core.wmem_max  net.ipv4.tcp_mem  net.ipv4.tcp_rmem  net.ipv4.tcp_wmem  Backlogs  net.core.netdev_max_backlog  net.core.somaxconn  net.ipv4.tcp_max_syn_backlog  Balance IRQs  echo f > /sys/class/net/eth0/queues/rx-0/rps_cpus
  18. 18. ©2015 Couchbase Inc. 18 Efficiency  ReduceTCP overhead  net.ipv4.tcp_sack  net.ipv4.tcp_fack  Reduce connection overhead  net.ipv4.tcp_fin_timeout  net.ipv4.tcp_tw_reuse  Enable auto-tuning  net.ipv4.tcp_moderate_rcvbuf  net.ipv4.tcp_window_scaling
  19. 19. ©2015 Couchbase Inc. 19 Jumbo Frames 8KB Object 1500B MTU 9000B MTUifconfig <dev> mtu 9000
  20. 20. CouchbaseTuning
  21. 21. ©2015 Couchbase Inc. 21 Bucket Settings
  22. 22. ©2015 Couchbase Inc. 22 Working Set Management Memory Quota mem_low_wat mem_high_wat
  23. 23. ©2015 Couchbase Inc. 23 Views  Design documents  Fewer reduces threads  More increases threads  Automated index updates  updateInterval  updateMinChanges  replicaUpdateMinChanges POST http://nodename:8091/settings/viewUpdateDaemon updateInterval=10000&updateMinChanges=1000
  24. 24. ©2015 Couchbase Inc. 24 XDCR
  25. 25. ©2015 Couchbase Inc. 25 Compaction
  26. 26. ©2015 Couchbase Inc. 26 Internal Settings http://nodename:8091/index.html?enableInternalSettings=1
  27. 27. Thank you.
  28. 28. Get Started withCouchbase Server 4.0: www.couchbase.com/beta GetTrained on Couchbase: training.couchbase.com

×