ganeti: add a section about disk cache configuration
[mirror/dsa-wiki.git] / input / howto / install-ganeti.creole
index d18ef4b..d88f024 100644 (file)
@@ -108,7 +108,7 @@ This is the interfaces file for bar.debian.org:
 
 On each node, configure lvm to ignore drbd devices and to prefer
 {{{/dev/cciss}}} devices names over {{{/dev/block}}} device names
-([[http://code.google.com/p/ganeti/issues/detail?id=93|why?]]):
+([[https://code.google.com/p/ganeti/issues/detail?id=93|why?]]):
 
 {{{
     ssed -i \
@@ -468,6 +468,31 @@ Order is important, or else things get very, very confused and the world needs a
   gnt-cluster command "echo 1 > /sys/bus/pci/devices/0000:0e:00.0/cciss0/rescan"
 }}}
 
+
+=== DRBD optimization ===
+
+The default DRBD parameters are not really optimized, which means very slow (re)syncing. The
+following commands might help to make it faster. Of course the max speed can be increased if
+both the network and disk speed allow that.
+
+{{{
+    gnt-cluster modify -D drbd:net-custom="--max-buffers 36k --sndbuf-size 1024k --rcvbuf-size 2048k"
+    gnt-cluster modify -D drbd:c-min-rate=32768
+    gnt-cluster modify -D drbd:c-max-rate=98304
+    gnt-cluster modify -D drbd:resync-rate=98304
+}}}
+
+
+=== Change the disk cache ===
+
+When using raw volumes or partitions, it is best to avoid the host cache completely to reduce data copies
+and bus traffic. This can be done using:
+
+{{{
+    gnt-cluster modify -H kvm:disk_cache=none
+}}}
+
+
 === Change the CPU type ===
 
 Modern processors come with a wide variety of additional instruction sets (SSE, AES-NI, etc.) which vary from processor to processor, but can greatly improve the performance depending on the workload. Ganeti and QEMU default to a compatible subset of cpu features called qemu64, so that if the host processor is changed, or a live migration is performed, the guest will see its CPUfeatures unchanged. This is great for compatibility but comes at a performance cost.
@@ -549,3 +574,14 @@ With the SandyBridge CPU type:
   aes-256-cbc     309840.39k   328612.18k   330784.68k   324245.16k   328116.91k
   aes-256-gcm     160820.14k   424322.20k   557212.50k   599435.61k   610459.65k
 }}}
+
+=== Add a virtio-rng device ===
+
+VirtIO RNG (random number generator) is a paravirtualized device that is exposed as a hardware RNG device to the guest. Virtio RNG just appears as a regular hardware RNG to the guest, which the kernel reads from to fill its entropy pool. Unfortunately Ganeti does not support it natively, therefore the kvm_extra option should be used. Ganeti forces the allocation of the PCI devices to specific slots, which means it is not possible to use the QEMU autoallocation and that an explicit PCI slot has to be provided. There 32 possible slots on the default QEMU machine, so we can use one of the last ones for example 0x1e.
+
+The final command to add a virtio-rng device cluster-wise is therefore:
+{{{
+  gnt-cluster modify -H kvm:kvm_extra="-device virtio-rng-pci\,bus=pci.0\,addr=0x1e\,max-bytes=1024\,period=1000"
+}}}
+
+The max-bytes and period options limit the entropy rate a guest can get to 1kB/s.