linux性能测试(转)

CPU的性能测试

sysbench run --test=cpu --cpu-max-prime=500000 --num-threads=100
等待测试执行完毕,记录输出结果包括整点运算性能、浮点运算性能、综合运算值

内存测试

软件编译:gcc -mtune=native -march=native -O3 -mcmodel=medium -fopenmp -DSTREAM_ARRAY_SIZE=100000000 -DNTIMES=10 stream.c -o stream.o
运行stream测试指令./stream.o

磁盘性能测试

(1)8K随机读:
例:fio -filename=/dev/sda -direct=1 -iodepth 10 -thread -rw=randread -ioengine=psync -bs=8k -size=10G -numjobs=20 -runtime=300 -group_reporting -name mytest
(2)8K随机写:
例:fio -filename=/dev/sda -direct=1 -iodepth 10 -thread -rw=randwrite -ioengine=psync -bs=8k -size=10G -numjobs=20 -runtime=300 -group_reporting -name mytest
(3)8K混合读写模型(70%读/30%写):
例:fio -filename=/dev/sda -direct=1 -iodepth 10 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=8k -size=10G -numjobs=20 -runtime=300 -group_reporting -name mytest
(4)64K顺序读:
例:fio -filename=/dev/sda -direct=1 -iodepth 10 -thread -rw=read -ioengine=psync -bs=64k -size=10G -numjobs=20 -runtime=300 -group_reporting -name mytest
(5) 64K顺序写:
例:fio -filename=/dev/sda -direct=1 -iodepth 10 -thread -rw=write -ioengine=psync -bs=64k -size=10G -numjobs=20 -runtime=300 -group_reporting -name mytest

网卡性能测试

在客户端和服务端,安装iperf

 TCP测试

服务器执行:#iperf -s -i 1 -w 1M

客户端执行:#iperf -c 192.168.0.241 -i 1 -w 1M

(或者在服务端执行:#clush –g srv “iperf -c 192.168.0.241 -i 1 -w 1M”)

其中-w表示TCP window size,192.168.0.241为服务器地址。

 UDP测试

服务器执行:#iperf -u -s

客户端执行:#iperf -u -c 192.168.0.241 -b 900M -i 1 -w 1M -t 60

(或者在服务端执行:#clush –g srv “iperf -u -c 192.168.0.241 -b 900M -i 1 -w 1M -t 60”)

其中-b表示使用带宽数量,千兆链路使用90%容量进行测试就可以了。

猜你喜欢

转载自www.cnblogs.com/alpha1981/p/9047635.html