[libvirt] [PATCH] daemon: Dynamically create worker threads when some get stuck

Daniel P. Berrange berrange at redhat.com
Thu Jun 16 17:29:09 UTC 2011


On Thu, Jun 16, 2011 at 04:29:55PM +0200, Michal Privoznik wrote:
> Up to now, we've created new worker threads only during new connection.
> This patch monitors worker threads for liveness and dynamically create
> new one if all are stuck, waiting for hypervisor to reply. This
> situation can happen. All one need to do is send STOP signal to qemu.
> The amount of time when we evaluate thread as stuck is defined in
> WORKER_TIMEOUT macro.
> 
> With this approach we don't need to create new worker thread on incoming
> connection. However, as number of active worker threads grows, it might
> happen we need to size up the pool of worker threads and hence exceed
> the max_worker configuration value.

This is really not desirable. The max_workers limit is in the
configuration as a static limit, to prevent client applications
from making libvirtd spawn an unlimited number of threads. We
must *always* respect the max_workers limit.

I don't think automatically spawning workers is the right way
to deal with the QEMU issue anyway. As mentioned before, we need
to improve the QEMU monitor driver so that we can safely allow
monitor commands to time out

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list