Comment 6 for bug 1100446

Revision history for this message
Daniel Berrange (berrange) wrote :

Using systemtap I counted & timed the libvirt API calls that Nova is making. On Fedora 18 with qemu 1.2.0 and libvirt 1.0.0, I get the following (nb times are cumulative execution time for all counted API calls, in milliseconds)

Current code, during startup

auth_list:66 count=2 time=2
auth_polkit:70 count=2 time=33
open:1 count=2 time=14
get_lib_version:157 count=1 time=1
get_capabilities:7 count=57 time=393
num_of_domains:51 count=7 time=8
num_of_defined_domains:25 count=2 time=2
domain_lookup_by_name:23 count=1 time=0
node_get_info:6 count=15 time=25
get_type:3 count=2 time=2
get_version:4 count=5 time=5
get_hostname:59 count=5 time=5

Clearly there are far too many calls to getCapabilities here, but it is still only 400ms total time on my machine

Just changing getCapablities to getLibVersion in the test connection code changes the results to look like

auth_list:66 count=2 time=2
auth_polkit:70 count=2 time=29
open:1 count=2 time=13
get_lib_version:157 count=49 time=59
num_of_domains:51 count=7 time=8
num_of_defined_domains:25 count=2 time=2
domain_lookup_by_name:23 count=1 time=1
node_get_info:6 count=15 time=26
get_capabilities:7 count=9 time=64
get_type:3 count=2 time=2
get_version:4 count=5 time=6
get_hostname:59 count=5 time=6

So as expected, there are far fewer calls to getCapabilities now, and correspondingly large number to getLibVersion(). Approx 300ms has been removed.

Looking at the periodic task, the current code results in

get_capabilities:7 count=22 time=126
node_get_info:6 count=6 time=8
num_of_domains:51 count=3 time=3
get_version:4 count=2 time=2
get_hostname:59 count=2 time=2
num_of_defined_domains:25 count=1 time=1

while the change to getLibVersion results in

get_lib_version:157 count=19 time=20
node_get_info:6 count=6 time=8
num_of_domains:51 count=3 time=3
get_capabilities:7 count=3 time=17
get_version:4 count=2 time=2
get_hostname:59 count=2 time=2
num_of_defined_domains:25 count=1 time=1