How do you limit block I/O?
AdvancedProductionResource Limits, Health & Reliability
Answer
docker run --device-read-bps /dev/nvme0n1:50mb --device-write-iops /dev/nvme0n1:500 app
Works at the block device level via cgroup io.max; it does not apply to writes absorbed by the page cache on cgroup v1 (v2 handles buffered writes properly). --blkio-weight gives proportional shares. Useful to stop noisy-neighbor batch jobs.
More on Resource Limits, Health & Reliability
How do you set memory and CPU limits, and what happens when they are exceeded?BeginnerWhat is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?BeginnerWhat does `--memory-reservation` do?AdvancedHow do you diagnose an OOM-killed container?IntermediateWhy do JVM and Node services in containers need explicit memory flags?IntermediateWhat is CPU throttling, and how do you detect it?Advanced