磁盘及网络测试工具(iperf hdparm dd)

简介:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
我的博客已迁移到xdoujiang.com请去那边和我交流
一、 网络测试工具iperf
1、安装包
apt-get -y  install  iperf
 
2、参数说明
-s, --server    run  in  server mode(以server模式启动)
-c, --client    <host> run  in  client mode, connecting to <host>(以client模式启动)
-p, --port      n  set  server port to listen on /connect  to to n (default 5001)指定服务器端使用的端口或客户端所连接的端口
-m, --print_mss print TCP maximum segment size (MTU - TCP /IP  header)显示tcp最大mtu值
-f, -- format     [kmKM]  format  to report: Kbits, Mbits, KBytes, MBytes(分别表示以Kbits, Mbits, KBytes, MBytes显示报告)
-i, --interval  n pause n seconds between periodic bandwidth reports(间隔时间)
-t, -- time       time  in  seconds to transmit  for  (default 10 secs)(默认10秒 连接时间)
-n, --num       n[KM] number of bytes to transmit (instead of -t)(传输大小是字节)
-w              TCP_WINDOW_SIZE Controls the size of TCP buffers(tcp)
 
3、购买的云主机服务器(监听在9999端口 本机外网ip 1.1.1.1)
iperf -s -p 9999 -m -w 102400000
 
4、公司内网客户端(连接服务端1.1.1.1)总连接时间200秒 服务端端口是9999 传输数据大小是10M左右)
iperf -c 1.1.1.1 -t 200 -f m -p 9999 -n 10240000 -w 102400000
------------------------------------------------------------
Client connecting to 1.1.1.1, TCP port 9999
TCP window size: 0.24 MByte (WARNING: requested 97.7 MByte)
------------------------------------------------------------
[  3]  local  10.1.10.250 port 41193 connected with 1.1.1.1 port 9999
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-20.2 sec  9.77 MBytes  4.06 Mbits /sec
总结:因公司环境因素 测试我云主机的服务器带宽才500KB(网卡 in 数据)
 
二、磁盘测试工具hdparm
1、安装包
apt-get -y  install  hdparm
 
2、hdparm -Tt  /dev/vdb
/dev/vdb :
  Timing cached reads:   19550 MB  in   2.00 seconds = 9786.98 MB /sec
  Timing buffered disk reads:  32 MB  in   3.03 seconds =  10.55 MB /sec
  
3、hdparm -Tt --direct  /dev/vdb
/dev/vdb :
  Timing O_DIRECT cached reads:    82 MB  in   2.02 seconds =  40.59 MB /sec
  Timing O_DIRECT disk reads: 124 MB  in   3.00 seconds =  41.28 MB /sec
 
4、参数说明 
-T       Perform timings of cache reads  for  benchmark and comparison purposes(测试硬盘读缓存的速度)
-t       Perform timings of device reads  for  benchmark and comparison purposes(测试硬盘读速度(不经过磁盘cache))
--direct Use the kernels  "O_DIRECT"  flag when performing a -t timing  test (直接硬盘读测试)
 
三、磁盘测试工具 dd
1、速度最慢的
dd  bs=64k count=4k  if = /dev/zero  of= test  oflag=dsync
4096+0 records  in
4096+0 records out
268435456 bytes (268 MB) copied, 307.7 s, 872 kB /s
 
2、比较常用的测试
dd  bs=64k count=4k  if = /dev/zero  of= test  conv=fdatasync
4096+0 records  in
4096+0 records out
268435456 bytes (268 MB) copied, 89.2378 s, 3.0 MB /s
 
3、比较常用的测试
dd  bs=64k count=4k  if = /dev/zero  of= test  conv=fsync
4096+0 records  in
4096+0 records out
268435456 bytes (268 MB) copied, 63.9118 s, 4.2 MB /s
 
4、带缓存的测试
dd  bs=64k count=4k  if = /dev/zero  of= test
4096+0 records  in
4096+0 records out
268435456 bytes (268 MB) copied, 0.321234 s, 836 MB /s
 
5、参数说明
dsync        use synchronized I /O  for  data
fdatasync    physically write output  file  data before finishing
fsync        likewise, but also write metadata
conv=CONVS   convert the  file  as per the comma separated symbol list
oflag=FLAGS  write as per the comma separated symbol list
bs=BYTES      read  and write up to BYTES bytes at a  time (同时设置读/写缓冲区的字节数)
count=BLOCKS copy only BLOCKS input blocks(只拷贝输入的blocks块)









本文转自 xdoujiang 51CTO博客,原文链接:http://blog.51cto.com/7938217/1669463,如需转载请自行联系原作者
目录
相关文章
|
6天前
|
测试技术 C语言
网站压力测试工具Siege图文详解
网站压力测试工具Siege图文详解
16 0
|
24天前
|
运维 网络协议 安全
【Shell 命令集合 网络通讯 】Linux 网络抓包工具 tcpdump命令 使用指南
【Shell 命令集合 网络通讯 】Linux 网络抓包工具 tcpdump命令 使用指南
44 0
|
27天前
|
网络协议 Linux 网络安全
curl(http命令行工具):Linux下最强大的网络数据传输工具
curl(http命令行工具):Linux下最强大的网络数据传输工具
36 0
|
28天前
|
JavaScript jenkins 测试技术
这10款性能测试工具,收藏起来,测试人的工具箱!
这10款性能测试工具,收藏起来,测试人的工具箱!
|
1月前
|
人工智能 监控 测试技术
利用AI辅助工具提升软件测试效率
【2月更文挑战第17天】 随着科技的不断发展,人工智能(AI)在各个领域的应用越来越广泛。在软件测试领域,AI技术也发挥着重要作用。本文将探讨如何利用AI辅助工具提升软件测试效率,包括自动化测试、智能缺陷识别和预测等方面。通过引入AI技术,软件测试过程将变得更加高效、准确和可靠。
147 1
|
1月前
|
Web App开发 前端开发 测试技术
探索自动化测试工具:Selenium的威力与应用
探索自动化测试工具:Selenium的威力与应用
探索自动化测试工具:Selenium的威力与应用
|
27天前
|
数据采集 JavaScript 前端开发
实用工具推荐:适用于 TypeScript 网络爬取的常用爬虫框架与库
实用工具推荐:适用于 TypeScript 网络爬取的常用爬虫框架与库
|
26天前
|
测试技术
现代软件测试中的自动化工具与挑战
传统软件测试面临着越来越复杂的系统架构和不断增长的测试需求,自动化测试工具应运而生。本文将探讨现代软件测试中自动化工具的应用和挑战,深入分析其优势与局限性,为软件测试领域的发展提供思路和启示。
|
22天前
|
jenkins 测试技术 持续交付
现代软件测试中的自动化工具与挑战
随着软件开发领域的不断发展,自动化测试工具在测试过程中扮演着越来越重要的角色。本文将探讨现代软件测试中自动化工具的应用及面临的挑战,旨在帮助开发人员和测试人员更好地理解和应对自动化测试中的问题。