Re: performance tuning, problem with paravirtualized clock

Anthony Liguori
2008-04-06T20:38:21Z

Nikola Ciprich wrote:
> Hi,
> I spent some time trying to tune performance of KVM guest using kernel
> compilation as a kind of benchmark (I'm using virtual machines for
> compiling a lot, so it's good benchmark for me in general)
>
> Host machine: 2x quad core XEON E5420 @ 2.50GHz, 4GB RAM, 2.6.24 + kvm-64
> guest configuration: all 8 cores available, 2GB RAM, 2.6.24 or latest GIT
> + kvm-64
>
> some results:
> - compilation in KVM guest is roughly 2x slower than on bare metal.
> - trying various block device backends (ide, scsi, virtio_blk) didn't
> really matter much for my case
> - enabling CONFIG_KVM_GUEST under latest GIT with kvm-64 patch applied
> decreased compile time by about 10%, which is nice!
> - enabling CONFIG_KVM_CLOCK made guest unstable, often unable to finish
> booting at all, disabling acpi made it a bit better, but still quite
> unstable (cpu0 lock-ups, etc)
>
> Is there currently anything more I could do to improve performance? I'm
> wandering what is slowing compilation, if I compare some CPU intensive
> application (ie bzip2), it seems to run in nearly native speed, but kernel
> compilation is much slower even if run from ramdisk, maybe it could be
> improved further by tunning scheduler etc?
>

I would think you should get about 70% of native with what you've done
about. I've not seen instabilities with CONFIG_KVM_CLOCK myself.

Setting up a hugetlbfs mount and using -mem-path may give you a bit of a
bump too but I'd be surprised if it was more than 5%

The next biggest win you're going to see is using NPT (available in the
recent AMD Barcelona/Phenom processors). NPT + hugetblfs should get
you pretty close to native (I'd reckon 95-98%).

On the Intel side of things, you'll have to wait until the Nehalem which
will support EPT (which is Intel's version of NPT).

Can you be specific about your guest configurations? Are you using -smp 8?

Regards,

Anthony Liguori

> anyways keep up the good work!
> cheers!
> nik
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Register now and save $200. Hurry, offer ends at 11:59 p.m.,
> Monday, April 7! Use priority code J8TLD2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel