From de9dc61ebcf55f4c2adf80d6b96de553cda01854 Mon Sep 17 00:00:00 2001 From: Artyom Date: Thu, 29 Oct 2026 03:50:30 +0300 Subject: [PATCH] Give RustFS room for the 100k point of the cost matrix The first cost run stalled while filling the bucket to 100k objects: RustFS keeps object metadata in memory, at about 45k objects it hit its 1 GiB limit, the cgroup kept reclaiming and PutObject slowed from about 240 to 11 objects per second. The S3 CPU limit is now taken from S3_CPUS (default 1, as before), and the cost run gives RustFS 2 pinned CPUs and 3 GiB for every point, so all N are measured with the same limits; seeding uses 16 parallel writes. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27 --- .env.example | 4 +++- compose.yaml | 2 +- scripts/reconcile_track.py | 19 +++++++++++-------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index e3be7a4f..7fac2122 100644 --- a/.env.example +++ b/.env.example @@ -51,10 +51,12 @@ UPLOAD_SWEEP_BATCH=100 # Fixed glibc mmap threshold for the API: buffers above 128 KiB are returned to the system on free. MALLOC_MMAP_THRESHOLD_=131072 # Solution-specific for lab4 track 2: limits of the one-off reconciler (profile reconcile), its S3 -# read timeout for listing pages, and optional CPU pinning of the measured services (empty = no pinning). +# read timeout for listing pages, optional CPU pinning of the measured services (empty = no pinning) +# and the CPU limit of RustFS (make reconcile-cost raises it with its memory for 100k objects). RECONCILE_CPUS=1 RECONCILE_MEMORY=256m RECONCILE_S3_READ_TIMEOUT_SECONDS=10 RECONCILE_CPUSET= S3_CPUSET= PG_CPUSET= +S3_CPUS=1 diff --git a/compose.yaml b/compose.yaml index aa1a1714..f84cb266 100644 --- a/compose.yaml +++ b/compose.yaml @@ -222,7 +222,7 @@ services: networks: [backend] deploy: resources: - limits: {cpus: "1", memory: "${S3_MEMORY:-512m}"} + limits: {cpus: "${S3_CPUS:-1}", memory: "${S3_MEMORY:-512m}"} reconciler: <<: *app diff --git a/scripts/reconcile_track.py b/scripts/reconcile_track.py index 1819985b..be2a5f61 100644 --- a/scripts/reconcile_track.py +++ b/scripts/reconcile_track.py @@ -425,14 +425,15 @@ def demo(args): def pins(args): cpus = int(must(["docker", "info", "--format", "{{.NCPU}}"]).strip()) + sized = {"S3_CPUS": "2", "S3_MEMORY": args.s3_memory} if args.no_pin or cpus < 8: - return {"S3_MEMORY": args.s3_memory} - return { - "S3_CPUSET": str(cpus - 4), - "PG_CPUSET": f"{cpus - 3}-{cpus - 2}", - "RECONCILE_CPUSET": str(cpus - 1), - "S3_MEMORY": args.s3_memory, - } + return sized + return dict( + sized, + S3_CPUSET=f"{cpus - 5}-{cpus - 4}", + PG_CPUSET=f"{cpus - 3}-{cpus - 2}", + RECONCILE_CPUSET=str(cpus - 1), + ) def limits(): @@ -462,6 +463,8 @@ def seed(count, env): "/tools/seed_storage.py", "--count", str(count), + "--concurrency", + "16", env=env, ) return json.loads(out.strip().splitlines()[-1]) @@ -578,7 +581,7 @@ def main(): k.add_argument("--deep-max", type=int, default=100000) k.add_argument("--page-compare", type=int, default=10000) k.add_argument("--settle", type=float, default=10) - k.add_argument("--s3-memory", default="1g") + k.add_argument("--s3-memory", default="3g") k.add_argument("--no-pin", action="store_true") args = p.parse_args() if args.command == "demo":