1、磁盘测试
1.1 读测试
hdparm 工具进行测试:
# 1.安装 hdparm
[root@bigdata ~]# yum install -y hdparm
# 2.查看硬盘符
[root@bigdata ~]# fdisk -l
# 3.读测试 (根据硬盘符)
[root@bigdata ~]# hdparm -t /dev/sda1
三次测试,结果如下:
Timing buffered disk reads: 7166 MB in 2.81 seconds = 2549.76 MB/sec
Timing buffered disk reads: 7166 MB in 2.89 seconds = 2481.30 MB/sec
Timing buffered disk reads: 7166 MB in 3.00 seconds = 2389.27 MB/sec
1.2 写测试
# 1.查看内存缓存
free -m
# 2.清除缓存
sync; echo 3 > /proc/sys/vm/drop_caches
# 3.查block size
blockdev --getbsz /dev/sda
# 4.写测试
echo 3 > /proc/sys/vm/drop_caches; time dd if=/dev/zero of=/test bs=4k count=100000
三次测试结果
409600000 bytes (410 MB) copied, 0.141356 s, 2.5 GB/s --> 410M复制,用时0.14s,评估2.5GB/s
409600000 bytes (410 MB) copied, 0.136734s, 2.3 GB/s --> 410M复制,用时0.13s,评估2.3GB/s
409600000 bytes (410 MB) copied, 0.155621 s, 2.4 GB/s --> 410M复制,用时0.15s,评估2.4GB/s