V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
helloworld12
V2EX  ›  问与答

docker-compose version 3 怎么限定 io 的使用

  •  
  •   helloworld12 · 2018-11-06 11:37:43 +08:00 · 1712 次点击
    这是一个创建于 2210 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用 prometheus

    感觉 整台机器的 IO 被打穿了。。。

    怎么限制单个节点的 IO

    网上的都是讲 CPU 和内存

    version: '3'
    services:
      redis:
        image: redis:alpine
        deploy:
    	  resources:
            limits:
    	      cpus: '0.50'
        	  memory: 50M
            reservations:
    	      cpus: '0.25'
        	  memory: 20M
    
    2 条回复    2021-07-25 03:06:02 +08:00
    feverzsj
        1
    feverzsj  
       2018-11-06 11:56:07 +08:00   ❤️ 1
    --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
    jewelz
        2
    jewelz  
       2021-07-25 03:06:02 +08:00
    blkio_config:
    weight: 200
    weight_device:
    - path: /dev/vda
    weight: 200
    device_read_bps:
    - path: /dev/vda
    rate: '24mb'
    device_read_iops:
    - path: /dev/vda
    rate: 2000
    device_write_bps:
    - path: /dev/vda
    rate: '48mb'
    device_write_iops:
    - path: /dev/vda
    rate: 75
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2965 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 14:37 · PVG 22:37 · LAX 06:37 · JFK 09:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.