Skip to content

Commit efa0435

Browse files
author
Andrei Neagu
committed
using faster settings for rclone
1 parent b33d48e commit efa0435

File tree

3 files changed

+38
-3
lines changed
  • packages
    • settings-library/src/settings_library
    • simcore-sdk/src/simcore_sdk/node_ports_common
  • services/agent/src/simcore_service_agent/services

3 files changed

+38
-3
lines changed

packages/settings-library/src/settings_library/r_clone.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,29 @@ class RCloneSettings(BaseCustomSettings):
3636
description="`--buffer-size X`: sets the amount of RAM to use for each individual transfer",
3737
),
3838
] = "16M"
39+
40+
R_CLONE_OPTION_CHECKERS: Annotated[
41+
NonNegativeInt,
42+
Field(
43+
description="`--checkers X`: sets the number checkers",
44+
),
45+
] = 32
46+
47+
R_CLONE_S3_UPLOAD_CONCURRENCY: Annotated[
48+
NonNegativeInt,
49+
Field(
50+
description="`--s3-upload-concurrency X`: sets the number of concurrent uploads to S3",
51+
),
52+
] = 8
53+
54+
R_CLONE_CHUNK_SIZE: Annotated[
55+
str,
56+
Field(description="`--s3-chunk-size X`: sets the chunk size for S3"),
57+
] = "128M"
58+
59+
R_CLONE_ORDER_BY: Annotated[
60+
str,
61+
Field(
62+
description="`--order-by X`: sets the order of file upload, e.g., 'size,mixed'",
63+
),
64+
] = "size,mixed"

packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
_logger = logging.getLogger(__name__)
3131

3232

33-
class BaseRCloneError(OsparcErrorMixin, RuntimeError):
34-
...
33+
class BaseRCloneError(OsparcErrorMixin, RuntimeError): ...
3534

3635

3736
class RCloneFailedError(BaseRCloneError):
@@ -207,6 +206,16 @@ async def _sync_sources(
207206
# https://forum.rclone.org/t/how-to-set-a-memory-limit/10230/4
208207
"--buffer-size", # docs https://rclone.org/docs/#buffer-size-size
209208
r_clone_settings.R_CLONE_OPTION_BUFFER_SIZE,
209+
"--checkers",
210+
f"{r_clone_settings.R_CLONE_OPTION_CHECKERS}",
211+
"--s3-upload-concurrency",
212+
f"{r_clone_settings.R_CLONE_S3_UPLOAD_CONCURRENCY}",
213+
"--s3-chunk-size",
214+
r_clone_settings.R_CLONE_CHUNK_SIZE,
215+
# handles the order of file upload
216+
"--order-by",
217+
r_clone_settings.R_CLONE_ORDER_BY,
218+
"--fast-list",
210219
"--use-json-log",
211220
# frequent polling for faster progress updates
212221
"--stats",

services/agent/src/simcore_service_agent/services/backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ async def _store_in_s3(
162162
# below two options reduce to a minimum the memory footprint
163163
# https://forum.rclone.org/t/how-to-set-a-memory-limit/10230/4
164164
"--buffer-size", # docs https://rclone.org/docs/#buffer-size-size
165-
"0M",
165+
"16M",
166166
"--stats",
167167
"5s",
168168
"--stats-one-line",

0 commit comments

Comments
 (0)