Linux 测试磁盘性能

简介:

 目前的机械磁盘运作方式,主要体现在磁盘读写寻找磁道的过程,磁盘缓存功能对于读写速度是很重要的。磁盘的寻道过程是机械方式,这样就决定其随机速度明显低于顺序读写,一般普通的磁盘的IO可以达到每秒 40--60MB,稍微好一点的话是每秒100MB左右,在多进程或多线程并发读取磁盘的情况下随着并发数的增加,磁盘的IO效率会打打下降。

    在 Linux下我们可以用dd命令对磁盘读写速度进行测试。

    用time进行计时。dd 用于复制, 从if 读出,写到of, 如果 if=/dev/zero 这样就不会产生IO,可以用来测试只写的速度,如果of=/dev/null 这样也不会产生IO,可以用来测试只读的速度。

    bs 表示每次读或写的单位大小。 count读写块的数目

    测试只写的速度:

    # time dd if=/dev/zero of=/mpc bs=8K count=1000
    1000+0 records in
    1000+0 records out
    8192000 bytes (8.2 MB) copied, 0.0109971 s, 745 MB/s

    real    0m0.031s
    user    0m0.000s
    sys     0m0.010s

     测试只读的情况:

     # time dd if=/mpc of=/dev/null bs=8K
     1000+0 records in
     1000+0 records out
     8192000 bytes (8.2 MB) copied, 0.0028807 s, 2.8 GB/s

     real    0m0.005s
     user    0m0.000s
     sys     0m0.000s

     测试读写的情况:

     # time dd if=/mpc of=/mpc2 bs=20K
     400+0 records in
     400+0 records out
     8192000 bytes (8.2 MB) copied, 0.0114427 s, 716 MB/s
     real    0m0.015s
     user    0m0.000s
     sys     0m0.010s    

    ps:测试的数据量越大,越准确。

 

 






本文转自 位鹏飞 51CTO博客,原文链接:http://blog.51cto.com/weipengfei/978801,如需转载请自行联系原作者

目录
相关文章
|
SQL 安全 Linux
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
712 1
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
1429 1
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
|
安全 Linux 网络安全
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
665 2
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
754 1
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
|
运维 Linux 开发者
Linux系统中使用Python的ping3库进行网络连通性测试
以上步骤展示了如何利用 Python 的 `ping3` 库来检测网络连通性,并且提供了基本错误处理方法以确保程序能够优雅地处理各种意外情形。通过简洁明快、易读易懂、实操性强等特点使得该方法非常适合开发者或系统管理员快速集成至自动化工具链之内进行日常运维任务之需求满足。
869 18
|
安全 Linux 网络安全
Metasploit Framework 6.4.88 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.88 (macOS, Linux, Windows) - 开源渗透测试框架
821 0
|
安全 Linux 测试技术
OpenText Static Application Security Testing (Fortify) 25.3 (macOS, Linux, Windows) - 静态应用安全测试
OpenText Static Application Security Testing (Fortify) 25.3 (macOS, Linux, Windows) - 静态应用安全测试
1019 0
|
存储 安全 Linux
Kali Linux 2025.3 发布 (Vagrant & Nexmon) - 领先的渗透测试发行版
Kali Linux 2025.3 发布 (Vagrant & Nexmon) - 领先的渗透测试发行版
1075 0
|
测试技术 UED 开发者
性能测试报告-用于项目的性能验证、性能调优、发现性能缺陷等应用场景
性能测试报告用于评估系统性能、稳定性和安全性,涵盖测试环境、方法、指标分析及缺陷优化建议,是保障软件质量与用户体验的关键文档。
|
缓存 安全 Linux
Metasploit Pro 4.22.8-2025082101 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025082101 (Linux, Windows) - 专业渗透测试框架
465 0