Red Hat Training

A Red Hat training course is available for RHEL 8

27.4. 更新默认的 qdisc

如果使用当前的 qdisc 观察网络数据包丢失情况,您可以根据您的网络要求更改 qdisc

步骤

  1. 查看当前的默认的 qdisc

    # sysctl -a | grep qdisc
    net.core.default_qdisc = fq_codel
  2. 查看当前以太网连接的 qdisc

    # tc -s qdisc show dev enp0s1
    qdisc fq_codel 0: root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb ecn
    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
    backlog 0b 0p requeues 0
    maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
    new_flows_len 0 old_flows_len 0
  3. 更新现有的 qdisc

    # sysctl -w net.core.default_qdisc=pfifo_fast

  4. 要应用更改,请重新加载网络驱动程序:

    # rmmod NETWORKDRIVERNAME

    # modprobe NETWORKDRIVERNAME

  5. 启动网络接口:

    # IP link set enp0s1 up

验证步骤

  • 查看以太网连接的 qdisc

    # tc -s qdisc show dev enp0s1
    qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
     Sent 373186 bytes 5333 pkt (dropped 0, overlimits 0 requeues 0)
     backlog 0b 0p requeues 0
    ....