My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
PerformanceTuning  
How to tune a ganeti cluster for performance
Updated Aug 4, 2011 by han...@google.com
  • This is work in progress, to be peer reviewed
  • (Initial document based on 1 experience and based on some disparate notes. Don't just apply these settings without extensive testing!)

Introduction

This page should evolve to a best practice guide on how to tune different parts of a ganeti cluster, for better performance.

KVM

cpu -host

ganeti should pass the -cpu host flag to kvm as to optimally use all cpu features? Issue 159 was filed to that end. In the mean time, this can be optained through a wrapper script. Following procedure is Debian/Ubuntu specific.

dpkg-divert --add --rename --divert /usr/bin/kvm.real /usr/bin/kvm
cat <<EOF > /usr/bin/kvm
#!/bin/sh
/usr/bin/kvm.real -cpu host "\$@" 
EOF
chmod +x /usr/bin/kvm

DRBD

See also Issue 57

latency tuning

As per http://www.drbd.org/users-guide/s-latency-tuning.html :

  1. use a dedicated nic for DRBD replication and configure jumbo frames: set the mtu on that interface as high as possible 7200-9000 -
  2. use the deadline scheduler on the disks used as PV's for the Volume Group(s) used by DRBD
gnt-cluster command aptitude install sysfsutils
cat <<EOF >>/etc/sysfs.conf
block/sda/queue/scheduler = deadline
block/sda/queue/iosched/front_merges = 0
block/sda/queue/iosched/read_expire = 150
block/sda/queue/iosched/write_expire = 1500
EOF
gnt-cluster copyfile /etc/sysfs.conf
gnt-cluster command /etc/init.d/sysfsutils restart

cat <<EOF >> /etc/sysctl.d/60-drbd-tuning.conf
# Increase "minimum" (and default) 
# tcp buffer to increase the chance to make progress in IO via tcp, 
# even under memory pressure. 
# These numbers need to be confirmed - probably a bad example.
#net.ipv4.tcp_rmem = 131072 131072 10485760 
#net.ipv4.tcp_wmem = 131072 131072 10485760 
# reduce water levels to start marketing background (and foreground) 
# write back early. Reduces the chance of resource starvation. 
#vm.dirty_ratio = 10
#vm.dirty_background_ratio = 4
EOF
gnt-cluster copyfile  /etc/sysctl.d/60-drbd-tuning.conf
gnt-cluster command "cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -p -"
Comment by laurent....@clarisys.fr, Aug 18, 2011

To avoid leaking a shell

cat <<EOF > /usr/bin/kvm
#!/bin/sh
/usr/bin/kvm.real -cpu host "\$@" 
EOF

Should be replaced with

cat <<EOF > /usr/bin/kvm
#!/bin/sh
exec /usr/bin/kvm.real -cpu host "\$@" 
EOF
Comment by groov...@gmail.com, Dec 29, 2011

Note you need x86info installed for the cpu flag passing to work apt-get install x86info in ubuntu at least


Sign in to add a comment
Powered by Google Project Hosting