Skip to content

Commit

Permalink
Modifying Chunk size
Browse files Browse the repository at this point in the history
  • Loading branch information
dma1dma1 committed May 23, 2024
1 parent 28d642f commit f491e0e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codalab/lib/beam/MultiReaderFileStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def read(self, index: int, num_bytes=0): # type: ignore
if new_bytes_needed > 0:
self._fill_buf_bytes(new_bytes_needed)
while (self._pos[index] + num_bytes) - self._buffer_pos > self.MAX_THRESHOLD:
time.sleep(.1) # 100 ms
time.sleep(10) # 100 ms

with self._lock:
old_position = self._pos[index] - self._buffer_pos
Expand Down
2 changes: 1 addition & 1 deletion codalab/lib/upload_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def write_fileobj(
conn_str = os.environ.get('AZURE_STORAGE_CONNECTION_STRING', '')
os.environ['AZURE_STORAGE_CONNECTION_STRING'] = bundle_conn_str
try:
CHUNK_SIZE = 16 * 1024
CHUNK_SIZE = 1024 * 1024

def upload_file_content():
iteration = 0
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/lib/upload_manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_upload_memory(self):
interval=0.1,
timeout=1
)
self.assertEqual(max(memory_usage) < 40000000, True)
self.assertEqual(max(memory_usage) < 90000000, True)

def write_string_to_file(self, string, file_path):
with open(file_path, 'w') as f:
Expand Down

0 comments on commit f491e0e

Please sign in to comment.