測試網絡轉發效能的方法-updating...

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

 

發佈了22 篇原創文章 · 獲贊 20 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章