diff options
| author | Jordan Pittier <jordan.pittier@scality.com> | 2017-01-09 15:40:59 +0100 |
|---|---|---|
| committer | Steve Martinelli <s.martinelli@gmail.com> | 2017-01-09 16:19:29 +0000 |
| commit | 1cdc1319d6cbfc4087551e5bf0a9875c016eca1c (patch) | |
| tree | 736e143846fb1a276456d06dbfdd8c9cf4d92393 /openstackclient/api | |
| parent | 1957690754961aed8bf9c7894e3ab140a9f2c0b9 (diff) | |
| download | python-openstackclient-1cdc1319d6cbfc4087551e5bf0a9875c016eca1c.tar.gz | |
Make 'object save' fast again
'openstack object save' is critically slow to download big objects. While
we 'stream' (chunked download) the data, the default chunks_size
is 1 byte [1], which is terribly inefficient.
[1] : http://docs.python-requests.org/en/master/api/#requests.Response.iter_content
Closes-Bug: 1654645
Change-Id: I2223e5897346acd2f2c1fae638d1193cff833c19
Diffstat (limited to 'openstackclient/api')
| -rw-r--r-- | openstackclient/api/object_store_v1.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openstackclient/api/object_store_v1.py b/openstackclient/api/object_store_v1.py index 184814c6..74c4a46f 100644 --- a/openstackclient/api/object_store_v1.py +++ b/openstackclient/api/object_store_v1.py @@ -380,7 +380,7 @@ class APIv1(api.BaseAPI): if len(os.path.dirname(file)) > 0: os.makedirs(os.path.dirname(file)) with open(file, 'wb') as f: - for chunk in response.iter_content(): + for chunk in response.iter_content(64 * 1024): f.write(chunk) def object_set( |
