• ltp-ddt eth过程中遇到的问题


    eth_iperf_tcp

    ETH_S_PERF_IPERF_TCP_INTPACING_8K_1448B source 'common.sh'; iface=`get_eth_iface_name.sh` || die "error getting eth interface name: $iface"; do_cmd "set_ethtool_coalesce_options.sh -d $iface -p 'rx-usecs' -n `get_eth_coalesce_parameter.sh`"; run_iperf.sh -m -M 1500 -f M -d -t 60 -w 8K; do_cmd "set_ethtool_coalesce_options.sh -d $iface -p 'rx-usecs' -n 16"

    iface=`get_eth_iface_name.sh`
    do_cmd "set_ethtool_coalesce_options.sh -d $iface -p 'rx-usecs' -n `get_eth_coalesce_parameter.sh`";
    run_iperf.sh -m -M 1500 -f M -d -t 60 -w 8K;
    do_cmd "set_ethtool_coalesce_options.sh -d $iface -p 'rx-usecs' -n 16"
    翻译过来:

    iface=eth0
    set_ethtool_coalesce_options.sh -d eth0 -p 'rx-usecs' -n `500`


    Cannot set device coalesce parameters: Invalid argument


    2. coalescing
    interrupt coalescing 主要是用来做 latency 跟 cpu overhead 之间的 trade-off。当 adapter 收到一个 frame 之后,不会立即的对系统产生中断,而是等一段时间,收集到更多的包之后再一次性的处理,这会降低 cpu 的负载,但是会产生 latency。要查看当前的 coalescing,可以:
    # ethtool  -c eth2 | grep "rx-usecs:"
    rx-usecs: 1

    interrupt coalescence 也叫 interrupt Moderation, Interrupt Blanking, or Interrupt Throttling。这个在 ixgbe 的参数列表里面也可以看到:
    parm:           InterruptThrottleRate:Maximum interrupts per second, per vector, (0,1,956-488281), default 1 (array of int)


    关于 rx-frames[-irq] rx-usecs[-irq] tx-frames[-irq] tx-usecs[-irq] 的解释,可以看这里

    可以使用下面这个命令来修改当前的值:
    # ethtool -C eth2 rx-usecs VALUE
    rx-usecs 会同时控制 tx 以及 rx 方向的 coalescing。值越低的,interrupt coalescence 越不容易发生,latency 越小,相应的,cpu 负载也会越大。如果增加了 rx-usecs,对于 bulk traffic 会比较好,但是会对 tcp 的性能造成大的损失,可以通过调大 TSO window divisor(默认为 3) 来弥补:
    net.ipv4.tcp_tso_win_divisor = 30

    前提需要开启 tso:
    # ethtool -K eth2 tso on

     

    TCP

    ETH_S_PERF_IPERF_TCP_8K_200B source 'common.sh'; run_iperf.sh -m -M 212 -f M -d -t 60 -w 8K
    ETH_S_PERF_IPERF_TCP_16K_200B source 'common.sh'; run_iperf.sh -m -M 212 -f M -d -t 60 -w 16K

    -w, --window #[KM]

    设置套接字缓冲区为指定大小。对于TCP方式,此设置为TCP窗口大小。对于UDP方式,此设置为接受UDP数据包的缓冲区大小,限制可以接受数据包的最大值。

    -M, --mss #[KM}

    通过TCP_MAXSEG选项尝试设置TCP最大信息段的值。MSS值的大小通常是TCP/IP头减去40字节。在以太网中,MSS值 为1460字节(MTU1500字节)。许多操作系统不支持此选项。

     

    UDP

    ETH_S_PERF_IPERF_UDP_1M_1500B source 'common.sh'; run_iperf.sh -w 128k -l 1500 -f M -u -t 60 -b 1M
    ETH_S_PERF_IPERF_UDP_5M_1500B source 'common.sh'; run_iperf.sh -w 128k -l 1500 -f M -u -t 60 -b 5M

    -b, --bandwidth #[KM]

    UDP模式使用的带宽,单位bits/sec。此选项与-u选项相关。默认值是1 Mbit/sec。

    -w, --window #[KM]

    设置套接字缓冲区为指定大小。对于TCP方式,此设置为TCP窗口大小。对于UDP方式,此设置为接受UDP数据包的缓冲区大小,限制可以接受数据包的最大值。

    -l, --len #[KM]

    设置读写缓冲区的长度。TCP方式默认为8KB,UDP方式默认为1470字节。

    为所有的协议队列设置操作系统层面的最大的发送 buffer size (wmem) 和 接收 buffer size (rmem)为 12 MB。换句话说,设置内存数量,分配给每一个为了传送文件而打开或者是创建的 tcp socket 。

     

     

  • 相关阅读:
    python 开启多进程的两种方法
    Python
    Python
    路由器配置
    python 自定义报头 实现大文件传输
    python socket
    Spring MVC 实现文件的上传
    SpringMVC异常处理
    SpringMVC 返回值类型,参数传递 解决乱码
    Spring—MVC案例
  • 原文地址:https://www.cnblogs.com/idyllcheung/p/10797578.html
Copyright © 2020-2023  润新知