Allow disabling ssl compression for glance client

Add a new parameter 'glance_api_ssl_compression' which allows
disabling ssl layer compression negotiation for glance requests.

This may improve data throughput, eg when high network bandwidth is
available and you are using already compressed image formats such as
qcow2 .

Addresses bug 1189903.

Change-Id: I180501cc25a1ea177d0d8c52a879682b8a3921c6
This commit is contained in:
Stuart McLaren 2013-06-11 13:55:20 +00:00
parent f34aef3a29
commit c927949616
3 changed files with 21 additions and 3 deletions

View File

@ -121,7 +121,15 @@ global_opts = [
cfg.BoolOpt('glance_api_insecure',
default=False,
help='Allow to perform insecure SSL (https) requests to '
'glance'),
'glance'),
cfg.BoolOpt('glance_api_ssl_compression',
default=False,
help='Whether to attempt to negotiate SSL layer compression '
'when using SSL (https) requests. Set to False to '
'disable SSL layer compression. In some cases disabling '
'this may improve data throughput, eg when high network '
'bandwidth is available and you are using already '
'compressed image formats such as qcow2 .'),
cfg.StrOpt('scheduler_topic',
default='cinder-scheduler',
help='the topic scheduler nodes listen on'),

View File

@ -60,12 +60,14 @@ def _create_glance_client(context, netloc, use_ssl,
"""Instantiate a new glanceclient.Client object."""
if version is None:
version = FLAGS.glance_api_version
params = {}
if use_ssl:
scheme = 'https'
# https specific params
params['insecure'] = FLAGS.glance_api_insecure
params['ssl_compression'] = FLAGS.glance_api_ssl_compression
else:
scheme = 'http'
params = {}
params['insecure'] = FLAGS.glance_api_insecure
if FLAGS.auth_strategy == 'keystone':
params['token'] = context.auth_token
endpoint = '%s://%s' % (scheme, netloc)

View File

@ -67,6 +67,14 @@
# (boolean value)
#glance_api_insecure=false
# Whether to attempt to negotiate SSL layer compression
# when using SSL (https) requests. Set to False to
# disable SSL layer compression. In some cases disabling
# this may improve data throughput, eg when high network
# bandwidth is available and you are using already compressed
# image formats such as qcow2 .
#glance_api_ssl_compression=false
# the topic scheduler nodes listen on (string value)
#scheduler_topic=cinder-scheduler