I'm doing some passive benchmarking with Linux Containers (LXC) vs KVM (1.0, disk cache=none, virtio). Tests are performed within the guest (VM / Container).
- The instances (VM / Container) are of the same size (e.g. 4G RAM, 2 CPU).
- Using out of the box MySQL 5.5 server; no custom cnf tweaks, etc..
- Running sysbench OLTP complex read / write tests.
What I'm seeing is that in LXC the following perf is substantially better than in KVM:
- File I/O reads and writes
- OLTP reads
However in the sysbench OLTP complex read / write test KVM and LXC are almost the same in terms of transaction throughput (over all thread sizes: 2, 16, 32, 64).
Do anyone have any incite as to way the OLTP complex r/w tests might be equal (KVM == LXC)?
Based on the little digging I have done, it appears that the buffer / caching at the db level (e.g. innodb buffer cache and related) may be "throttling" this test and hence LXC perf = KVM perf. Also the complex r/w OLTP test is transactional thus locks the (single) table which could be a limiting factor. However I'd tried non-locking r/w tests as well as the iibench test -- in these cases again KVM == LXC perf wise.
When I look at the metrics collected from these tests (using dstat) I see the KVM set of tests getting a higher IOPS rate, but I've been unable to determine why.
Many thanks for any incite.