When processing the header of HTTP responses from Xend, libvirt currently
reads data a single byte at a time. Since its using lowlevel UNIX read()
function there is no buffering, which results in a large number of system
calls. The attached patch re-factors the code so that it reads data in
4k chunks whenever possible. Since most rsponses are < 4k in size processing
the response now only takes two read() syscalls, rather than several hundred.
Of course most (90%) of the CPU overhead is still on the Xend/XenStored
end of the channel, but that's out of our control until the XML-RPC API
comes along.
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|