Bug 1265144 - Reduce time in filtering JSON Data received from the guest agent
Reduce time in filtering JSON Data received from the guest agent
Status: CLOSED CURRENTRELEASE
Product: vdsm
Classification: oVirt
Component: Core (Show other bugs)
4.17.5
Unspecified Unspecified
medium Severity medium (vote)
: ovirt-4.0.0-alpha
: 4.17.999
Assigned To: Vinzenz Feenstra [evilissimo]
Eldad Marciano
:
Depends On: 1179696
Blocks: 1177634
  Show dependency treegraph
 
Reported: 2015-09-22 04:26 EDT by Vinzenz Feenstra [evilissimo]
Modified: 2016-08-02 06:23 EDT (History)
12 users (show)

See Also:
Fixed In Version: ovirt 4.0.0 alpha1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1179696
Environment:
Last Closed: 2016-08-02 06:23:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.0.0+
rule-engine: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 50945 None None None 2016-01-06 07:16 EST
oVirt gerrit 51039 None None None 2016-01-06 07:17 EST

  None (edit)
Description Vinzenz Feenstra [evilissimo] 2015-09-22 04:26:59 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.
Comment 1 Vinzenz Feenstra [evilissimo] 2015-09-22 04:30:25 EDT
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 07:19:35 EST
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 06:23:09 EST
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 06:23:05 EDT
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.