MySQL and Virtualization
In this talk, I will discuss how to effectively use MySQL with KVM.
Virtualization has been there for long, however, it is quite underutilized and
also discourage in lieu of performance. However, for a minimal / no loss of
performance, one will be able to take advantage of high availability (obtained from
ability to move VMs across boxes) along with native I/O performance (from
virtio, filesystem passthrough and PCI passthrough), greater instrumentation,
sharing of data (in case of MySQL, the database), lower memory footprint (from
KSM). The talk will also have a developer perspective on how to use it for
MySQL development / testing.
KVM has been one of the latest entrants to the field of virtualization (not
everything is emulated, especially performance intensive, so virtualization !=
emulation here). Its development is quite active (main development takes place
in kernel tree) and has made a mark for itself wrt. performance.
Now, wrt. MySQL, it offers several unique advantages. There are some who are
ready to sacrifice performance (slight compared to bare-metal) in bargain for
features like high availability, backups (live / incremental backups!), the loss
in performance can be compensated by deploying more than one (or whatever
necessary) or by having multiple guests (much better).
Performance is mainly considered under:
2. Disk I/O
The talk will stress on each of the two, viz, using virtio / vhost_net for
improved network performance (very close to native) and virtio (instead of
virtualizing, allowing host in host I/O) / PCI passthrough (allowing one to pass
PCI-E devices to guests - fusion-io etc.) / filesystem passthrough (based on 9p,
the rationale being that instead of duplication, passthrough common trees of
filesystem like /usr or /home etc.)
KSM and multiple guests with buffer pools -- this has not explored before by
anyone else. however it will be quite interesting to see this. KSM does
deduplication of pages, so one can get a lower memory footprint while at the
same time maintaining full buffer pools on guests -- this is like the
passthrough equivalent for memory, non-dirtied memory is shared by the guests.
Instrumentation with perf-kvm is supported. This can be used to examine the
guest level events from the host.
Finally, use of KVM in MySQL development / testing will be discussed and
demonstrated. The complete kvm scripting along with above mentioned features
like passthrough will be demonstrated for rapid test <-> development of MySQL.