[libvirt] Re: virDomainCreate() response time

Daniel P. Berrange berrange at redhat.com
Wed Dec 2 18:49:21 UTC 2009

On Wed, Dec 02, 2009 at 01:33:58PM -0500, Christopher Pyper wrote:
> I am using xen with libvirt and I have very slow response times with 
> calls to virDomainCreate().  It takes approximately 5-6 seconds to 
> return.  Other calls like virDomainReboot() or virtDomainShutdown()
> return immediately.  Do you know what might be causing this, and 
> how I might speed this up.

libvirt is at the mercy of Xen here, and Xen is very very slow at creating
new guests, which is reflected in the length of time virDomainCreate()
takes :-( There's nothing we can really do about this.

There's a couple of things where Xen is slow which you might be able to
tune yourself though

 - Xenstored is incredibly slow at I/O. Putting the /var/lib/xenstore
   directory onto tmpfs does wonders for improving this. Many distros
   set xen up this way by default now, but its worth checking in case
   yours doesn't.
 - Ballooning down Dom0 to free up RAM to use for DomU takes a while.
   This is because Linux generally likes to use all free RAM for cache
   and so before Dom0 can be ballooned down, the Dom0 kernel has to 
   free up this RAM which may in turn require disk I/O etc, etc. If
   you keep Dom0 ballooned down to a small limit, then you can avoid
   XenD having to balloon Dom0 itself when starting guests.

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvir-list mailing list