比如我的服务器上运行 4 个容器,限制每个容器只能使用到 nvme 设备 25%的性能,即便其他容器没有在使用时也是如此。
1
chuckzhou 2023-02-10 21:46:35 +08:00
~$ docker help run | grep -E 'bps|IO'
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] --blkio-weight Block IO (relative weight), between 10 and 1000 --blkio-weight-device=[] Block IO weight (relative device weight) --device-read-bps=[] Limit read rate (bytes per second) from a device --device-read-iops=[] Limit read rate (IO per second) from a device --device-write-bps=[] Limit write rate (bytes per second) to a device --device-write-iops=[] Limit write rate (IO per second) to a device |
3
OutOfMemoryError 2023-02-10 22:10:53 +08:00
@wniming #2 我没记错的话 docker 现在默认使用 systemd ,但是也支持 cgroups 管理 那应该是支持的
|
4
pagxir 2023-02-11 00:31:08 +08:00
lxc-cgroup -n armbian blkio.throttle.read_bps_device "230:0 1048576"
|
5
cmingxu 2023-02-23 09:17:58 +08:00 1
分 writeback 和 directio ,directio 好说,writeback 比较麻烦
|