测试网络转发效能的方法-updating...

20 篇文章 2 订阅
15 篇文章 0 订阅

1. ab

yum install httpd

ab -c 20000 -n 60000 http://10.1.1.1/   

 

2. iperf3

使用iperf测试转发速率可参考如下链接

https://discuss.aerospike.com/t/benchmarking-throughput-and-packet-count-with-iperf3/2791

server端运行 iperf3 -s

client端运行 iperf3 -c 1.1.1.1 -p 4567 -i 1 -t 100 -l 88 -V -M 88 -b 1000000000

-l option is the buffer size. Actually this doesn't matter too much.   
-M option is the MTU size.   The default is 1500.  Here we set it low to get a high packet count. The throughput is set high.
-p  port number
-c server IP address
-t is time for the test in seconds 
-i option is the interval for output. 
-b is the bandwidth in bits per second.  This number should be set to the maximum bandwidth for the network interface.

 

Linux系统下可以运行如下脚本查看网卡实时的封包转发速率

#!/bin/bash

INTERVAL="1"  # update interval in seconds

if [ -z "$1" ]; then
        echo
        echo usage: $0 [network-interface]
        echo
        echo e.g. $0 eth0
        echo
        echo shows packets-per-second
        exit
fi

IF=$1

while true
do
        R1=`cat /sys/class/net/$1/statistics/rx_packets`
        T1=`cat /sys/class/net/$1/statistics/tx_packets`
        sleep $INTERVAL
        R2=`cat /sys/class/net/$1/statistics/rx_packets`
        T2=`cat /sys/class/net/$1/statistics/tx_packets`
        TXPPS=`expr $T2 - $T1`
        RXPPS=`expr $R2 - $R1`
        echo "TX $1: $TXPPS pkts/s RX $1: $RXPPS pkts/s"
 done

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值