参考http://www.thomas-krenn.com/en/wiki/Linux_I/O_Performance_Tests_using_dd

Measuring Write Performance

Modern operating systems do not normally write files immediately to RAID systems or hard disks. Temporary memory that is not currently in use will be used to cache writes and reads (regarding this, see also Operating System Caches).

So that I/O performance measurements will not be affected by these caches (temporary memory), the oflag parameter can be used. Thereby, the following two flags are interesting (for details, see dd --help and Dd using direct or synchronized I/O):

direct (use direct I/O for data)

dsync (use synchronized I/O for data)

sync (likewise, but also for metadata)

For measuring write performance, the data to be written should be read from /dev/zeroempty RAID array, hard disk or partition (such as using of=/dev/sda for the first hard disk or of=/dev/sda2 for the second partition on the first hard disk). If this is not possible, a normal file in the file system (such as using of=/root/testdatei1GB) can be written. The write performance achieved thereby will be a little slower (because metadata will also be written to the file system).

Important: When writing to a device (such as /dev/sda), the data stored there will be lost. For that reason, you should only use empty RAID arrays, hard disks or partitions.

Note:

When using if=/dev/zero and bs=1G, Linux will need 1GB of free space in RAM. If your test system does not have sufficient RAM available, use a smaller parameter for bs (such as 512MB).

In order to get results closer to real-life, we recommend performing the tests described several times (three to ten times, for example). By doing so, you can quickly detect outliers. Such outliers can include cron jobs, interrupts or general conditions due to parallel processing, which can all briefly affect performance. An extreme example, which clarifies this issue, would be the parallel execution of updatedb by a cron job.

Laptop Example

In this example, the test data will be written to /dev/sda2. The test system (a Thinkpad T43 Type 2668-4GG) had 1.5 GByte of RAM and a Fujitsu MHT2060AH hard disk rotating at 5,400 rpm.

Laptop Throughput (Streaming I/O)

One gigabyte was written for the test, first with the cache activated (hdparm -W1 /dev/sda):

root@grml ~ # dd if=/dev/zero of=/dev/sda2 bs=1G count=1 oflag=direct

1+0 records in

1+0 records out

1073741824 bytes (1.1 GB) copied, 32.474 s, 33.1 MB/s

root@grml ~ #

Then, with the cache deactivated (hdparm -W0 /dev/sda):

root@grml ~ # dd if=/dev/zero of=/dev/sda2 bs=1G count=1 oflag=direct

1+0 records in

1+0 records out

1073741824 bytes (1.1 GB) copied, 123.37 s, 8.7 MB/s

root@grml ~ #

Laptop Latency

In this test, 512 bytes were written one thousand times, first with the cache activated (hdparm -W1 /dev/sda):

root@grml ~ # dd if=/dev/zero of=/dev/sda2 bs=512 count=1000 oflag=direct

1000+0 records in

1000+0 records out

512000 bytes (512 kB) copied, 0.36084 s, 1.4 MB/s

root@grml ~ #

Then, with the cache deactivated (hdparm -W0 /dev/sda): One thousand accesses required 11.18 seconds, meaning one access took 11.18 ms.

root@grml ~ # dd if=/dev/zero of=/dev/sda2 bs=512 count=1000 oflag=direct

1000+0 records in

1000+0 records out

512000 bytes (512 kB) copied, 11.1865 s, 45.8 kB/s

root@grml ~ #

Server with RAID10 Example

In this example, the test data was written to an empty partition. The test system was an 2HE Intel Dual-CPU SC823 Server with six 147 GB SAS Fujitsu MBA3147RC (15,000 rpm) hard disks and an Adaptec 5805 RAID controller with the cache activated and a BBU.

Server Throughput (Streaming I/O)

One gigabyte was written for the test:

test-sles10sp2:~ # dd if=/dev/zero of=/dev/sda6 bs=1G count=1 oflag=dsync

1+0 records in

1+0 records out

1073741824 bytes (1.1 GB) copied, 5.11273 seconds, 210 MB/s

test-sles10sp2:~

Server Latency

In this test, 512 bytes were written one thousand times. Thereby, the 0.084 seconds that were measured for one thousand accesses corresponded to precisely 0.084 ms for each access. This value is so low because of the RAID controller’s cache:

test-sles10sp2:~ # dd if=/dev/zero of=/dev/sda6 bs=512 count=1000 oflag=dsync

1000+0 records in

1000+0 records out

512000 bytes (512 kB) copied, 0.083902 seconds, 6.1 MB/s

test-sles10sp2:~ #

linux中怎么测试i o,[linux]linuxI/O测试的方法之dd相关推荐

  1. 19. linux中权限详解,Linux权限位,读写执行权限真正含义,chmod详解

    linux中权限详解,Linux权限位,读写执行权限真正含义,chmod详解 文章目录 Linux权限位 读写执行 三种权限真正含义和作用 权限对文件的作用 权限对目录的作用 示例 chmod 使用数 ...

  2. centos sudo不能运行_如何在 Linux 中配置 sudo 访问权限 | Linux 中国

    Linux 系统中 root 用户拥有 Linux 中全部控制权力.Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为.-- Magesh Maruthamuthu Lin ...

  3. linux 查看ip_如何在 Linux 中查看可用的网络接口 | Linux 中国

    对于某些人来说,他们更偏爱在安装完系统后再进行网络的配置或者更改现存的设置.众所周知,为了在命令行中进行网络设定的配置,我们首先必须知道系统中有多少个可用的网络接口.-- Sk 在我们安装完一个 Li ...

  4. linux中_Linux基础知识(Linux系统、Linux中的链表)

    Linux系统简介 Linux系统的结构及特点 Linux系统的结构图如下图所示: 从上图可以看出,Linux是一个典型的宏内核(一体化内核)结构.硬件系统上面时硬件抽象层,在硬件抽象层上面时内核服务 ...

  5. linux使用grep查找文件内容,Linux中使用grep命令搜索文件名及文件内容的方法

    这篇文章主要介绍了Linux中使用grep命令搜索文件名及文件内容的方法,同时文中还介绍了将匹配结果高亮显示的方法,相当实用,需要的朋友可以参考下 从文件中搜索并显示文件名 当从多个文件中搜索时,默认 ...

  6. linux取证教程,Linux中的取证(Forensics in Linux)

    Linux中的取证(Forensics in Linux) 数字调查的主要问题是通过加密或任何其他格式保护重要证据或数据. 基本示例是存储密码. 因此,有必要了解Linux操作系统在数字取证实施中的使 ...

  7. linux中怎么看挂载文件系统,Linux中如何查看已挂载的文件系统类型详解

    前言 如你所知,Linux 支持非常多的文件系统,例如 ext4.ext3.ext2.sysfs.securityfs.FAT16.FAT32.NTFS 等等,当前被使用最多的文件系统是 ext4.你 ...

  8. linux中通过date命令获取昨天或明天时间的方法

    linux中通过date命令获取昨天或明天时间的方法 date命令可以获取当前的时间,通过man,可以看到date有很多参数可以用,很容易做到格式化 date +"%F" 输出格式 ...

  9. linux中-i选项的作用,linux – find中的-prune选项有什么作用?

    我可以看到-prune找不到正常工作.我猜-name"efence *"-prune选项应该选择(或找到)除了名称为efence *的文件之外的所有文件? 或者我的理解是错的? 我 ...

  10. linux中动态链接库用扩展名,Linux操作系统下动态库的生成及链接方法是什么?...

    Linux下动态库文件的扩展名为".so"(Shared Object).按照约定,所有动态库文件名的形式是libname.so(可能在名字中加入版本号).这样,线程函数库被称作l ...

最新文章

  1. android ndk怎样加载o文件_JNI初探之NDK 开发环境配置
  2. 利用SimpleHttpServer+urllib传文件
  3. 深度学习之四:常用模型和方法
  4. BZOJ2958 序列染色
  5. Java big file debug - random access
  6. 20个常用的正则表达式
  7. Java 算法 乘积最大
  8. (71)信号发生器DDS方波设计 (一)(第15天)
  9. IG击败TOP进入春季赛决赛 王思聪督战时吃玉米动作亮了
  10. 快速排序算法思路分析和C++源代码(递归和非递归)
  11. 二分图匹配匈牙利算法BFS实现
  12. 主板定制X86嵌入式器件选型
  13. 本人译著《Professional Xcode 3》现已翻译完毕
  14. 思科网院Packet Tracer实验(七)IP编址
  15. 计算机网络体系结构综述(上)
  16. vray许可服务器信息怎么看不到,VRay for sketchup的许可证问题怎么解决?
  17. 【游戏逆向】FPS网络游戏自动瞄准漏洞分析以及实现二
  18. 从十亿光年到0.1飞米:从宇宙到细胞,从宏观到微观
  19. 骨龄预测代码学习(三)
  20. 树形控件--zTree 很好很强大

热门文章

  1. 增量式pid_PID 基础知识汇总
  2. 科学家风采 | 杜小勇、周傲英、王万良获批首批国家级虚拟教研室建设试点项目!...
  3. 第三届“信息论与编码”中大论坛诚邀您的参加
  4. 【2017年第4期】大数据标准体系
  5. 【计算机组成原理】CPU
  6. 【Python】Matplotlib利用楔形绘制圆环形饼图
  7. 回文质数(洛谷P1217题题解,Java语言描述)
  8. Fibonacci思想的灵活应用(洛谷P1011题题解,Java语言描述)
  9. Mac 10.12连接iSCSI硬盘软件iSCSI Initiator X
  10. 【贪心】【高精度】zoj3987 Numbers