Skip to content

[broker] parameter "loadBalancerOverrideBrokerNicSpeedGbps" does not work #14820

Closed

Description

@graysonzeng

Describe the bug
machine:tencent Cloud Virtual Machine,CVM
os: tencent os tlinux 2.6
i wanna set loadBalancerOverrideBrokerNicSpeedGbps=9 to setting to correct the max NIC speed bandwidthout, but it does not work because org.apache.pulsar.broker.loadbalance.impl.LinuxBrokerHostUsageImpl getNics() get two nics,one is physical Nic eth1,another one is virtual Nic veth51f9d919

To Reproduce
Steps to reproduce the behavior:

  1. set broker parameter loadBalancerOverrideBrokerNicSpeedGbps=9
  2. check nics path
[root@9 ~]# cd /sys/class/net
[root@9 /sys/class/net]# ls -l
total 0
lrwxrwxrwx 1 root root 0 Mar  8 21:01 cbr0 -> ../../devices/virtual/net/cbr0
lrwxrwxrwx 1 root root 0 Mar  8 21:01 dummy0 -> ../../devices/virtual/net/dummy0
lrwxrwxrwx 1 root root 0 Mar  8 20:59 eth1 -> ../../devices/pci0000:00/0000:00:05.0/virtio0/net/eth1
lrwxrwxrwx 1 root root 0 Mar  8 21:01 kube-ipvs0 -> ../../devices/virtual/net/kube-ipvs0
lrwxrwxrwx 1 root root 0 Mar  8 20:59 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 Mar  8 21:03 veth51f9d919 -> ../../devices/virtual/net/veth51f9d919
  1. Becasue org.apache.pulsar.broker.loadbalance.impl.LinuxBrokerHostUsageImpl isPhysicalNic(Path path) path is relative path, so veth51f9d919 in !path.toString().contains("/virtual/") is true, Expected false。
  2. In this condition, org.apache.pulsar.broker.loadbalance.impl.LinuxBrokerHostUsageImpl getTotalNicLimitKbps() return 18874368, Expected 9437184。the setting max NIC speed bandwidthout does not work

Expected behavior
virtual nic veth51f9d919 in !path.toString().contains("/virtual/") is false。

Screenshots
use tool arthas to watch params and returnObj
image

/sys/class/net relative path
image

Desktop (please complete the following information):

  • OS: tencent os tlinux 2.6

Additional context
i wanna fix this issue

Activity

  1. added
    type/bug
    on Mar 23, 2022
  2. grssam commented on Dec 7, 2022

    @grssam
    Contributor

    PS: due to filtering virtual nics out, in k8s pods, all nics are now filtered out (since all of them are virtual, at least on our hardware) and thus network doesn't contribute at all to the broker host load.
    I have personally confirmed that the eth0 nic paths still continues to show the correct rx and tx values for the broker though even though its under /virtual/

    cat /sys/class/net/eth0/statistics/tx_bytes
    1027980743970
    

    (the counter updates with correct rate as monitored in dstat)

    pulsar@pulsar-broker-6:~$ ls -larth /sys/class/net/
    total 0
    drwxr-xr-x 29 root root 0 Oct 31 18:08 ..
    drwxr-xr-x  2 root root 0 Oct 31 18:08 .
    lrwxrwxrwx  1 root root 0 Oct 31 18:08 lo -> ../../devices/virtual/net/lo
    lrwxrwxrwx  1 root root 0 Oct 31 18:08 eth0 -> ../../devices/virtual/net/eth0
    
  3. Technoboy- commented on Dec 8, 2022

    @Technoboy-
    Contributor

    PS: due to filtering virtual nics out, in k8s pods, all nics are now filtered out (since all of them are virtual, at least on our hardware) and thus network doesn't contribute at all to the broker host load. I have personally confirmed that the eth0 nic paths still continues to show the correct rx and tx values for the broker though even though its under /virtual/

    cat /sys/class/net/eth0/statistics/tx_bytes
    1027980743970
    

    (the counter updates with correct rate as monitored in dstat)

    pulsar@pulsar-broker-6:~$ ls -larth /sys/class/net/
    total 0
    drwxr-xr-x 29 root root 0 Oct 31 18:08 ..
    drwxr-xr-x  2 root root 0 Oct 31 18:08 .
    lrwxrwxrwx  1 root root 0 Oct 31 18:08 lo -> ../../devices/virtual/net/lo
    lrwxrwxrwx  1 root root 0 Oct 31 18:08 eth0 -> ../../devices/virtual/net/eth0
    

    Thanks for reporting this. we're working on the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions