Bug 1367826 - [scale] - Python SDK: Enable HTTP compression by default
Summary: [scale] - Python SDK: Enable HTTP compression by default
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-python
Classification: oVirt
Component: Core
Version: 4.0.0a
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ovirt-4.1.0-alpha
: 4.1.0
Assignee: Ondra Machacek
QA Contact: Eldad Marciano
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-17 14:51 UTC by Eldad Marciano
Modified: 2017-02-01 14:57 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Previously, Python SDK was configured to communicate with the server using uncompressed responses. This caused long response times. In this release, the default configuration is to send compressed responses.
Clone Of:
Environment:
Last Closed: 2017-02-01 14:57:15 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.1+
gklein: testing_plan_complete-
rule-engine: planning_ack+
mperina: devel_ack+
eberman: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 62569 0 master MERGED Enable HTTP compression by default 2016-10-04 13:57:21 UTC

Description Eldad Marciano 2016-08-17 14:51:30 UTC
Description of problem:
when scanning a large scale list without compress can be found long response time.

when compress=True we got much faster response time 

see the comparison:
compress False
list size cap 100 response time 4.50143885612
list size cap 300 response time 11.0167760849
list size cap 500 response time 27.9535710812

compress True
list size cap 100 response time 2.03919100761
list size cap 300 response time 1.44519710541
list size cap 500 response time 2.07873082161



Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. api.system_service().hosts_service().list(max=x amount of objects)
2.
3.

Actual results:
compress not enabled by default

Expected results:
compress should be enabled by default

Additional info:

Comment 1 Yaniv Kaul 2016-08-17 14:57:42 UTC
juan - what is the status of compression in the new Ruby gem, which the new provider in CFME uses? Can this speed up initial inventory fetch?

Any downside to this being the default? (higher CPU usage on the client? not sure  it's an issue).

Comment 2 Juan Hernández 2016-08-17 15:19:34 UTC
Compression is also supported in the Ruby SDK, but it isn't enabled by default. Enabling it is a matter of adding the "compress=True" parameter (in Python) or ":compress => true" parameter (in Ruby).

In the CFME provider compression isn't enabled:

  https://github.com/ManageIQ/manageiq/blob/master/app/models/manageiq/providers/redhat/infra_manager.rb#L65

Enabling it could speed up initial inventory fetch, but I guess that not a lot, as most of the time is due to the multiple network round-trips between ManageIQ and oVirt. I don't have numbers to back this statement.

CPU usage is a downside, but probably not the most important. I believe that the most important downside is debugging. If compression is enabled then the debug messages (if debug is enabled) contain the compressed output (this is how libcurl works) which makes them almost useless.

As debugging isn't enabled by default in ManageIQ I think we can enable compression. We should probably also add configuration parameters so that the ManageIQ user/developer can enable/disable both debugging and compression.

Comment 3 Martin Perina 2016-08-24 04:55:22 UTC
Targeting to 4.1 for now, if needed we can backport to 4.0.z (in that we case we would need separate bugs for each SDK).

Comment 4 Sandro Bonazzola 2016-12-12 14:01:23 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 5 Eldad Marciano 2017-01-09 14:35:11 UTC
verified on top of sdk 4.1: 
-=>>python /usr/lib64/python2.7/site-packages/ovirtsdk4/version.py
4.1.0a0

when ignore the compress flag when creating the api object:

list size cap 10 response time 1.23655796051
list size cap 300 response time 1.87913990021
list size cap 500 response time 2.52585601807


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