Bug #1521
closed
Foreman open a new libvirt connection each time the hypervisor page is loaded
Added by David Douard almost 13 years ago.
Updated almost 13 years ago.
Description
Foreman opens a new connection each time the page of a libvirt hypervisor is loaded, (may consume all possible libvirtd connections).
I am using a qemu+tls connection to libvirt.
I am using Foreman on a Debian squeeze installed from foreman deb repository (0.4.2-1).
netstat shows that tcp connections stay ESTABLISHED until libvirtd or foreman is restarted.
Yes, I gave a quick look at the code, which looks fine at first sigh (but I am no Rubyist).
How can I activate logging to try to find what is going on? Maybe adding some print statements somewhere?
Humm I've digged a bit, and the disconnect method of Virt.Connection is properly called. Thus the problem may reside in the ruby wrapper for libvirt (I use the Debian package, aka libvirt-ruby1.8 0.0.7-1), unless a reference to the libvirt connection instance is kept somewhere preventing it from being garbage collected, or some similar stuff (not sure this is relevant here).
I have compiled libvirt-ruby 0.4.0 and the behavior seems much better. TCP connections go in state TIME_WAIT after a short amount of time, then are closed completely.
I'll make more tests tomorrow, but I think I have the culprit...
- Status changed from New to Feedback
hmm.. so can we mark this as resolved?
Ohad, my virt ESX code tried to fix this issue. I think we should be caching the libvirt object anyways instead of open/closing the connection so many times. Every time virt opens a connection it has to make so many calls to libvirt.
Ohad Levy wrote:
hmm.. so can we mark this as resolved?
I did not have time to make extensive tests (as I wanted to do), but it looks that this can be marked as solved.
- Status changed from Feedback to Resolved
Corey Osman wrote:
Ohad, my virt ESX code tried to fix this issue. I think we should be caching the libvirt object anyways instead of open/closing the connection so many times. Every time virt opens a connection it has to make so many calls to libvirt.
Corey I agree, however, as we are planning to swap to using fog for libvirt (and probably use virt within fog) this might be a different context for discussion <-- Thanks!
Also available in: Atom
PDF