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
This commit is contained in:
parent
1957690754
commit
1cdc1319d6
@ -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(
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Makes ``openstack object save`` much faster when saving an object to disk.
|
||||
[Bug `1654645 <https://bugs.launchpad.net/bugs/1654645>`_]
|
Loading…
Reference in New Issue
Block a user