From 7d78cc4b9d43f5abdf8c7fa05e37ab8c8122c325 Mon Sep 17 00:00:00 2001 From: Nobuto Murata Date: Fri, 19 May 2023 09:36:49 +0900 Subject: [PATCH] Bump the CHUNKSIZE to use CPU more efficiently The chunk size used for downloading images was 64KiB for some time. That is okay for relatively small images but the client side of CPU can be a bottleneck especially for large images. Bump the default chunk size from 64KiB to 1MiB so we can use the client side CPU more efficiently. [64KiB chunk size - current] INFO cinder.image.image_utils Image download 1907.35 MB at 68.61 MB/s -> ~ 549 Mbps [1MiB chunk size - patched] INFO cinder.image.image_utils Image download 1907.35 MB at 132.10 MB/s -> 1,057 Mbps Closes-Bug: #2020139 Change-Id: I8b6e19621fc989526b02319d88fcfde88a17eee0 --- glanceclient/common/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index e24ba357..f8c48dc5 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -40,7 +40,7 @@ osprofiler_web = importutils.try_import("osprofiler.web") LOG = logging.getLogger(__name__) USER_AGENT = 'python-glanceclient' -CHUNKSIZE = 1024 * 64 # 64kB +CHUNKSIZE = 1024 * 1024 # 1MiB REQ_ID_HEADER = 'X-OpenStack-Request-ID' TOKEN_HEADERS = ['X-Auth-Token', 'X-Service-Token']