[libvirt-users] advice on creating and reusing connections
Daniel Veillard
veillard at redhat.com
Wed Mar 31 20:21:39 UTC 2010
On Wed, Mar 31, 2010 at 10:32:13AM -0700, jeremy avnet wrote:
> Are there any recommendations as to how often a new connection should be
> made versus reused? Right now we create a new connection *every time* we hit
> libvirt for something. We can easily change this so that a single connection
> is made for a series of libvirt calls, or even so that a single connection
> is used for the lifetime of the running application.
>
> What are the issues to consider when making these choices?
libvirt API used to be not thread safe, so for concurrent or GUI
related it was often a good idea to at least have one connection per
thread. Those days it's not really needed. Note that most operations
in libvirt are synchronous, and a few are rather long running so
it's tempting to have concurrent operations in different threads.
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvirt-users
mailing list