Red Hat Bugzilla – Bug 1265144
Reduce time in filtering JSON Data received from the guest agent
Last modified: 2016-08-02 06:23:05 EDT
+++ This bug was initially created as a clone of Bug #1179696 +++
Description of problem:
Currently the guest agent message handling contains inefficiencies which cause quite significant time spent during handling of messages sent by guest agents of VMs.
The 2 most significant portions of this have been identified as the filtering of bad characters and the dispatching of the message to the appropriate handler.
This bug shall address these issues.
--- Additional comment from Michal Skrivanek on 2015-01-07 12:39:18 CET ---
might want to consider backporting based on profiling results with the patch/solution.
--- Additional comment from Vinzenz Feenstra [evilissimo] on 2015-01-15 09:09:11 CET ---
I have made some investigations:
I have produced a 25 MiB data capture of the messages sent by the guest agent including bigger application lists reported by windows guest agents.
I written a little script which read each message from the data capture and passed it as string to the line processing. Which decodes the utf-8 data, parses the json to an python object and then applies the filtering.
The current solution takes around 20-22 seconds on my machine.
Another solution suggested by Nir Sofer (can be seen in attached gerrit patch)
takes around 14-16 seconds on each run.
The pure python approach as suggested by Nir has a performance gain of 30%.
For the sake of completeness I have been attempting to try a non-optimized c++ version of parsing json, decoding the object etc, takes around 800ms on my computer for the same 25 MiB. Which just proves that there's plenty of room for improvement. We'll have to see however how we would do this, and this is not something what would go into a backport.
As the discussion came up we're now investigating to post-pone the filtering to a later point, and filter the data only for XMLRPC requests before it's passed along. And only parse certain fields.
This is a discussion which has to be continued on the mailing list, to see if this is relevant.
This BZ is for tracking the improvement on filtering the data received by VDSM from the guest agent.
There has been made a big improvement in the change - The guest agent filtering was sped up with the attached patches.
The path of dropping the filtering for JSONRPC is not feasible as we still need to ensure for correct data otherwise the engine would fail on it eventually.
Therefore the additional speed gain by the added patches will help us a lot with scale.
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.
This bug was fixed and is slated to be in the upcoming version. As we
are focusing our testing at this phase on severe bugs, this bug was
closed without going through its verification step. If you think this
bug should be verified by QE, please set its severity to high and move
it back to ON_QA