linux 测速(Linux speed measurement)

简介:

混玩各种机器,x86 X64 ARM ARML

总要测测速度吧,看看瓶颈在什么地方。

一:磁盘读测速

hdparm –t 设备名(/dev/sda1)

二:磁盘写测速

time dd if=/dev/zero of=/tmp/test.dat bs=1G count=1

三:网路上下行测速

iperf命令是一个网络性能测试工具,可以测试TCP和UDP带宽质量。同时也可以通过UDP测试报告网丢包率或者发包性能,是一个非常实用的工具。

iperf安装:

可以直接通过官网下载对应系统版本进行安装(https://iperf.fr/iperf-download.php)

1.对于windows版的iPerf,直接将解压出来的iperf.exe和cygwin1.dll复制到%systemroot%目录即可

2.对于linux版的iPerf,软件库如果没有,可以这样安装:

rpm -ivh iperf-<version>.rpm

常用参数指南(详见附录):

-c/s:客户端模式/服务端模式

-p:指定iperf测试端口

-i:指定报告间隔

-b:设置UDP的发送带宽,单位bit/s

-t:设置测试的时长,单位为秒,不设置默认10s

-l:指定包大小,TCP默认8k,UDP默认1470字节

带宽性能测试:

1、针对TCP进行带宽性能测试

服务端命令:iperf -s -i 1 -p 3389

客户端命令:iperf -c 172.19.16.97 -p 3389 -i 1

2、针对UCP进行带宽性能测试

服务端命令: iperf -u -s -i 1 -p 3389

客户端命令 :

iperf -u -c 172.19.16.97 -p 3389 -b 1500M -i 1 

iperf -u -c 172.19.16.97 -p 3389 -b 2000M -i 1 

————————

Introduction:

Play with various machines, x86 x64 arm arml

Always measure the speed and see where the bottleneck is.

1: Disk reading speed measurement

Hdparm – t device name (/ dev / sda1)

2: Disk write speed measurement

time dd if=/dev/zero of=/tmp/test.dat bs=1G count=1

3: Network uplink and downlink speed measurement

Iperf command is a network performance test tool, which can test the bandwidth quality of TCP and UDP. At the same time, you can also report the network packet loss rate or contract performance through UDP test. It is a very practical tool.

iperf安装:

You can directly download the corresponding system version through the official website for installation( https://iperf.fr/iperf-download.php )

1. For iperf of Windows version, directly decompress the extracted iperf Exe and cygwin1 DLL can be copied to the% systemroot% directory

2. For iperf for Linux, if there is no software library, you can install it as follows:

rpm -ivh iperf-<version>.rpm

Guidelines for common parameters (see Appendix for details):

-C / s: client mode / Server Mode

-p: Specify iperf test port

-i: Specify reporting interval

-b: Set the transmission bandwidth of UDP, in bit / s

-t: Set the test duration, in seconds, and do not set the default 10s

-l: Specifies the packet size. TCP defaults to 8K and UDP defaults to 1470 bytes

Bandwidth performance test:

1. Bandwidth performance test for TCP

Server command: iperf – S – I 1 – P 3389

Client command: iperf – C 172.19.16.97 – P 3389 – I 1

2. Bandwidth performance test for UCP

Server command: iperf – U – S – I 1 – P 3389

Client commands:

iperf -u -c 172.19.16.97 -p 3389 -b 1500M -i 1 

iperf -u -c 172.19.16.97 -p 3389 -b 2000M -i 1