一、磁盘基本信息查询
df -h:查看磁盘分区、大小、使用比例、mount点,这个地方会涉及到/dev/shm,一个磁盘内存区,这里面的文件实际上是加载到内存里面的。
fdisk -lu:磁盘总大小、扇区大小、磁柱的个数等。
dumpe2fs /dev/sda1:查看某个分区的具体情况,可以查看到磁盘文件系统block大小。
二、磁盘流量查看
dstat -df:磁盘每个分区的读写流量情况
iostat -xk 5:更具体的信息查询,主要关注的如下2项。这个命令默认系统是没有的,需要通过yum install sysstat安装才能使用
await: The average time (in milliseconds) for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
%util:Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100%.
三、磁盘 raid
具体介绍参见:http://molinux.blog.51cto.com/2536040/516008
性能比较:关于raid:今天实验了一下raid10和raid5的写性能问题,raid10写性能确实不错,基本不耗用cpu wait,但是raid5基本占用70~80%cpu wait,所以在不需要备份时,采用raid0是首选,性能好。
常见磁盘写性能:SATA: 150MB/s, SAS: 300MB/s, SSD: 500MB/s
四、异步读写
参见之前写的两篇文章: