Bug 1265144 - Reduce time in filtering JSON Data received from the guest agent
Summary: Reduce time in filtering JSON Data received from the guest agent
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: Core
Version: 4.17.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.0.0-alpha
: 4.17.999
Assignee: Vinzenz Feenstra [evilissimo]
QA Contact: Eldad Marciano
URL:
Whiteboard:
Depends On: 1179696
Blocks: 1177634
TreeView+ depends on / blocked
 
Reported: 2015-09-22 08:26 UTC by Vinzenz Feenstra [evilissimo]
Modified: 2016-08-02 10:23 UTC (History)
12 users (show)

Fixed In Version: ovirt 4.0.0 alpha1
Clone Of: 1179696
Environment:
Last Closed: 2016-08-02 10:23:05 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 50945 0 None None None 2016-01-06 12:16:39 UTC
oVirt gerrit 51039 0 None None None 2016-01-06 12:17:16 UTC

Description Vinzenz Feenstra [evilissimo] 2015-09-22 08:26:59 UTC
+++ 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.

Comment 1 Vinzenz Feenstra [evilissimo] 2015-09-22 08:30:25 UTC
This BZ is for tracking the improvement on filtering the data received by VDSM from the guest agent.

Comment 2 Vinzenz Feenstra [evilissimo] 2016-01-06 12:19:35 UTC
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.

Comment 3 Red Hat Bugzilla Rules Engine 2016-01-15 11:23:09 UTC
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.

Comment 4 Gil Klein 2016-08-02 10:23:05 UTC
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


Note You need to log in before you can comment on or make changes to this bug.