Read GETs in 1MB chunks

Previously, we would read the whole response into memory, which would
likely cause swift-bench to get killed when using larger objects.

Change-Id: I2b11a3c4ac4690539d3a67fc11a0f5e1777a9b7a
This commit is contained in:
Tim Burke
2024-07-17 13:07:17 -07:00
parent dee1430b42
commit 3a269af476

View File

@@ -25,7 +25,7 @@ import random
import signal import signal
import socket import socket
import logging import logging
from contextlib import contextmanager from contextlib import contextmanager, closing
from optparse import Values from optparse import Values
import eventlet import eventlet
@@ -473,8 +473,13 @@ class BenchGET(Bench):
with self.connection() as conn: with self.connection() as conn:
try: try:
if self.use_proxy: if self.use_proxy:
client.get_object(self.url, self.token, headers, body = client.get_object(
container_name, name, http_conn=conn) self.url, self.token,
container_name, name, http_conn=conn,
resp_chunk_size=2**20)
with closing(body):
for _ in body:
pass
else: else:
node = {'ip': self.ip, 'port': self.port, 'device': device} node = {'ip': self.ip, 'port': self.port, 'device': device}
direct_client.direct_get_object(node, partition, direct_client.direct_get_object(node, partition,