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