4

KVM的虚机如何限速

 7 months ago
source link: https://bajie.dev/posts/20240124-kvm_limit_bandwidth/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

KVM的虚机如何限速

2024-01-24 1 分钟阅读

需要开一台kvm的测试机,但是需要限制速度,10M

我们的物理机使用了bridge,以及vlan tag,所以虚机的网卡是br0.141

查了一圈文档

    <interface type='bridge'>
      <mac address='52:54:00:db:4c:5f'/>
      <source bridge='br0.141'/>
      <bandwidth>
        <inbound average='1250' peak='1250' burst='1250'/>
        <outbound average='1250' peak='1250' burst='1250'/>
      </bandwidth>
      <model type='virtio'/>

注意限速的单位:是kilobyte per second

1250 kilobyte per second, KB/s = 10 Mbps = 1.25 MB/s

10 Mbps就是通常意义上的网速,/8=1.25 MB/s,就是机器上用下载软件比如迅雷下载,看到的速度(1.25 MB/s)。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK