Repository navigation
CI: cap the RustFS blocking-thread pool on the CAS-S3 lanes and collect its log - #2384
Conversation
…b artifact RustFS shares the job container's cgroup with the ClickHouse server, so its memory is charged against `max_server_memory_usage`. RustFS 1.0.0-rc.3 grows its tokio blocking-thread pool one thread per concurrent blocking dispatch and keeps idle threads for 60 s; each thread pins about 13 MB. On the MSan CAS-S3 stateless shards this reached 1074 threads and 14 GB of anonymous memory over three hours. Set the runtime knobs that cap the pool and let it shrink, enable allocator reclaim, and use relaxed durability (no fsync chain; the pool is wiped per run). Measured locally on the same six-pass workload: 1074 -> 130 threads, 14.4 GB -> 2.5 GB anonymous, `rename_data` 44-69 ms -> 0.6 ms, the run 30% faster. `RUSTFS_OBS_USE_STDOUT=true` routes the RustFS log (error level by default) into `rustfs.log`, which the job already uploads; without it RustFS writes under its cwd and the artifact stays empty. Related: #2298 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01GhVd7eMAWdFubNk4g1B2Tx Signed-off-by: Mikhail Filimonov <[email protected]>
PR #2384 Distributed-Systems Audit
No confirmed distributed-systems defects in reviewed scope. Model assumptions
The one contract change is
Coverage summary
Limits. Static review of the diff and of the RustFS durability document at |
PR #2384 CI Verification ReportVerification (2026-09-24)
VerdictNo failure is caused by this PR. The change is a CI script. None of the red checks exercise it in a way that explains the failure.
Source uploadCategory: The job failed at The same check fails on other PRs (66 of 684 commits) and on Stateless MSan CAS shard 1Category: The report is
The server log shows why, one second earlier: The lease deadline had already passed, so the disk stopped accepting writes. The four tests (
This check reports The ten Stateless MSan CAS shards 2 and 3Category: GitHub shows both as failed. The Actions conclusion is On the runs that do finish, the same two checks fail anyway: shard 2/3 has a |
CI only, one file (
ci/jobs/scripts/clickhouse_proc.py,start_rustfs): environment knobs for the RustFS instance that backs the CAS-S3 stateless lanes, plus routing its log into the existingrustfs.logartifact. No server code, no test changes.Why RustFS memory counts as ClickHouse memory. The stateless job runs the server, MinIO, azurite, RustFS and the test workers in one docker container, i.e. one cgroup, with no
--memoryflag. The server'sMemoryWorkeruses the cgroup source, which sums the whole cgroup'sanonfrommemory.stat, andmax_server_memory_usageis derived from the host (0.9 × 30.6 GiB). So every byte RustFS allocates is charged against the server's limit: it inflatesMemoryTracking, drives the memory-cappedmax_threads, and under ASan produced theCode: 241storms.Why RustFS grows. RustFS 1.0.0-rc.3 runs every disk I/O through tokio's
spawn_blocking: under the default strict durability a PUT costs four or more blocking dispatches (write, fsync chain, rename). The blocking pool grows one thread per concurrent dispatch, an idle thread lives 60 s, and each thread pins about 12 MB of retained mimalloc arena plus a 1 MiB stack. Under a parallel test suite the pool only ratchets up: on a three-hour MSan shard it reached 1074 threads and 14 GB of anonymous memory (r = 0.95 between thread count and RSS). The same mechanism also maderename_datacost 37–69 ms per call.Knobs
RUSTFS_RUNTIME_MAX_BLOCKING_THREADS64RUSTFS_RUNTIME_THREAD_KEEP_ALIVE5RUSTFS_ALLOCATOR_RECLAIM_ENABLEDtrueRUSTFS_ALLOCATOR_RECLAIM_INTERVAL_SECS30RUSTFS_DURABILITY_MODErelaxedrename_dataand halves thread demand. Acceptable for CI: the pool lives underci/tmpand is wiped per runRUSTFS_OBS_USE_STDOUTtruerustfs.logartifact gets content; today RustFS writes tologs/under its cwd and the artifact is nearly emptyLocal measurement (same six-pass workload of the MSan CAS-S3 shard, CI MSan binary, two RustFS instances; knobs applied to the CAS instance only, the other one as control):
rename_dataper callCode: 241in test outputThe five memory knobs were measured together, so their individual contributions are not separated; the durability knob is the one with a semantic cost and is intended for CI only. The RustFS log volume at error level was 1.5 MB over 143 minutes.
Related: #2298
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
CI: cap the RustFS blocking-thread pool and enable allocator reclaim on the CAS-S3 stateless lanes, so the object store no longer inflates the server's cgroup memory; collect the RustFS log as an artifact.
Documentation entry for user-facing changes
CI/CD Options
Exclude tests:
Regression jobs to run:
🤖 Generated with Claude Code
https://claude.ai/code/session_01GhVd7eMAWdFubNk4g1B2Tx