Skip to content

Commit cedba0e

Browse files
Document max concurrent writes (TraceMachina#2169)
* Document max concurrent filesystem writes * Update config example from JSON to JSON5 Changed code block syntax from json to json5 for better compatibility.
1 parent 23611ca commit cedba0e

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

web/platform/src/content/docs/docs/config/basic-configs.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ memory and filesystem stores instead of S3 and Redis.
2626
"filesystem": {
2727
"content_path": "/tmp/nativelink/data-worker-test/content_path-ac",
2828
"temp_path": "/tmp/nativelink/data-worker-test/tmp_path-ac",
29+
// Limit concurrent writes to avoid disk I/O saturation.
30+
// Set to 0 for unlimited.
31+
"max_concurrent_writes": 8,
2932
"eviction_policy": {
3033
// 1gb.
3134
"max_bytes": 1000000000,
@@ -40,6 +43,9 @@ memory and filesystem stores instead of S3 and Redis.
4043
"filesystem": {
4144
"content_path": "/tmp/nativelink/data-worker-test/content_path-cas",
4245
"temp_path": "/tmp/nativelink/data-worker-test/tmp_path-cas",
46+
// Limit concurrent writes to avoid disk I/O saturation.
47+
// Set to 0 for unlimited.
48+
"max_concurrent_writes": 8,
4349
"eviction_policy": {
4450
// 10gb.
4551
"max_bytes": 10000000000,

web/platform/src/content/docs/docs/config/production-config.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,20 @@ Here is the final CAS Config JSON without the 99 extra shards for writing to S3.
454454
}
455455
```
456456
457+
## Limit Concurrent Filesystem Writes
458+
459+
If the CAS server is under heavy disk I/O pressure, cap the number of
460+
simultaneous writes to the filesystem store with `max_concurrent_writes`.
461+
Each write streams to a temp file and calls `sync_all()`, which can saturate
462+
the disk and block the async runtime if too many happen at once.
463+
464+
```json5
465+
"filesystem": {
466+
"content_path": "/var/lib/nativelink/cas",
467+
"temp_path": "/var/lib/nativelink/tmp",
468+
// Set to 0 for unlimited.
469+
"max_concurrent_writes": 16
470+
}
457471
## Limit Worker Inflight Tasks
458472

459473
If your workers are getting saturated, cap the number of concurrent tasks they

0 commit comments

Comments
 (0)