Add swift_store_ssl_compression param
Add a new glance-api.conf parameter 'swift_store_ssl_compression', which allows disabling SSL layer compression for https swift requests. This can increase performance when transferring compressed images (eg qcow2) to/from swift. Addresses bug 1190666. DocImpact. Change-Id: Ic26dba9dce5ea7e5c09fdd531746b93cec54fc5c
This commit is contained in:
parent
4954ea5a09
commit
8a85be099e
@ -527,6 +527,19 @@ Optional. Default: ``publicURL``
|
||||
A string giving the endpoint type of the swift service endpoint to
|
||||
use. This setting is only used if swift_store_auth_version is ``2``.
|
||||
|
||||
* ``swift_store_ssl_compression``
|
||||
|
||||
Can only be specified in configuration files.
|
||||
|
||||
`This option is specific to the Swift storage backend.`
|
||||
|
||||
Optional. Default: True.
|
||||
|
||||
If set to False, disables SSL layer compression of https swift
|
||||
requests. Setting to 'False' may improve performance for images which
|
||||
are already in a compressed format, eg qcow2. If set to True then
|
||||
compression will be enabled (provided it is supported by the swift
|
||||
proxy).
|
||||
|
||||
|
||||
Configuring the S3 Storage Backend
|
||||
|
@ -315,6 +315,12 @@ swift_enable_snet = False
|
||||
# is only necessary if the tenant has multiple swift endpoints.
|
||||
#swift_store_region =
|
||||
|
||||
# If set to False, disables SSL layer compression of https swift requests.
|
||||
# Setting to 'False' may improve performance for images which are already
|
||||
# in a compressed format, eg qcow2. If set to True, enables SSL layer
|
||||
# compression (provided it is supported by the target swift proxy).
|
||||
#swift_store_ssl_compression = True
|
||||
|
||||
# ============ S3 Store Options =============================
|
||||
|
||||
# Address where the S3 authentication service lives
|
||||
|
@ -102,6 +102,11 @@ swift_opts = [
|
||||
help=_('A list of tenants that will be granted read/write '
|
||||
'access on all Swift containers created by Glance in '
|
||||
'multi-tenant mode.')),
|
||||
cfg.BoolOpt('swift_store_ssl_compression', default=True,
|
||||
help=_('If set to False, disables SSL layer compression of '
|
||||
'https swift requests. Setting to False may improve '
|
||||
'performance for images which are already in a '
|
||||
'compressed format, eg qcow2.')),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -267,6 +272,7 @@ class BaseStore(glance.store.base.Store):
|
||||
self.endpoint_type = CONF.swift_store_endpoint_type
|
||||
self.snet = CONF.swift_enable_snet
|
||||
self.insecure = CONF.swift_store_auth_insecure
|
||||
self.ssl_compression = CONF.swift_store_ssl_compression
|
||||
|
||||
def get(self, location, connection=None):
|
||||
location = location.store_location
|
||||
@ -574,7 +580,8 @@ class SingleTenantStore(BaseStore):
|
||||
return swiftclient.Connection(
|
||||
auth_url, user, location.key, insecure=self.insecure,
|
||||
tenant_name=tenant_name, snet=self.snet,
|
||||
auth_version=self.auth_version, os_options=os_options)
|
||||
auth_version=self.auth_version, os_options=os_options,
|
||||
ssl_compression=self.ssl_compression)
|
||||
|
||||
|
||||
class MultiTenantStore(BaseStore):
|
||||
@ -654,7 +661,8 @@ class MultiTenantStore(BaseStore):
|
||||
preauthurl=location.swift_url,
|
||||
preauthtoken=self.context.auth_tok,
|
||||
tenant_name=self.context.tenant,
|
||||
auth_version='2', snet=self.snet, insecure=self.insecure)
|
||||
auth_version='2', snet=self.snet, insecure=self.insecure,
|
||||
ssl_compression=self.ssl_compression)
|
||||
|
||||
|
||||
class ChunkReader(object):
|
||||
|
@ -692,7 +692,7 @@ class FakeConnection(object):
|
||||
def __init__(self, authurl, user, key, retries=5, preauthurl=None,
|
||||
preauthtoken=None, snet=False, starting_backoff=1,
|
||||
tenant_name=None, os_options={}, auth_version="1",
|
||||
insecure=False):
|
||||
insecure=False, ssl_compression=True):
|
||||
self.authurl = authurl
|
||||
self.user = user
|
||||
self.key = key
|
||||
|
@ -25,7 +25,7 @@ iso8601>=0.1.4
|
||||
oslo.config>=1.2.0a3
|
||||
|
||||
# For Swift storage backend.
|
||||
python-swiftclient>=1.2
|
||||
python-swiftclient>=1.5
|
||||
|
||||
# Note you will need gcc buildtools installed and must
|
||||
# have installed libxml headers for lxml to be successfully
|
||||
|
Loading…
Reference in New Issue
Block a user