FreeBSD:基准化磁盘搜寻和传输性能

时间:2020-01-09 10:38:28  来源:igfitidea点击:

我如何在FreeBSD操作系统下对磁盘搜索和传输性能进行简单的基准测试?
在FreeBSD操作系统下,如何对RAID-1阵列的I/O读取命令开销进行简单的测量?

您需要使用diskinfo命令,该命令显示有关磁盘设备的信息,并有选择地在该设备上运行幼稚的性能测试。

-t选项用于简单的性能测试。

I/O读取的简单测量

-c选项触发对I/O读取命令开销的简单测量,执行:

# diskinfo -c /dev/aacd0

输出示例:

/dev/aacd0
	512         	# sectorsize
	299573968896	# mediasize in bytes (279G)
	585105408   	# mediasize in sectors
	36421       	# Cylinders according to firmware.
	255         	# Heads according to firmware.
	63          	# Sectors according to firmware.

I/O command overhead:
	time to read 10MB block      0.062739 sec	=    0.003 msec/sector
	time to read 20480 sectors   1.169154 sec	=    0.057 msec/sector
	calculated command overhead			=    0.054 msec/sector

磁盘的简单基准

-t选项触发磁盘搜索和传输性能的简单且相当幼稚的基准,请执行:

# diskinfo -t /dev/aacd0

输出示例:

/dev/aacd0
	512         	# sectorsize
	299573968896	# mediasize in bytes (279G)
	585105408   	# mediasize in sectors
	36421       	# Cylinders according to firmware.
	255         	# Heads according to firmware.
	63          	# Sectors according to firmware.

Seek times:
	Full stroke:	  250 iter in   0.724105 sec =    2.896 msec
	Half stroke:	  250 iter in   0.716784 sec =    2.867 msec
	Quarter stroke:	  500 iter in   2.109663 sec =    4.219 msec
	Short forward:	  400 iter in   1.621695 sec =    4.054 msec
	Short backward:	  400 iter in   1.624951 sec =    4.062 msec
	Seq outer:	 2048 iter in   0.119046 sec =    0.058 msec
	Seq inner:	 2048 iter in   0.217687 sec =    0.106 msec
Transfer rates:
	outside:       102400 kbytes in   0.649656 sec =   157622 kbytes/sec
	middle:        102400 kbytes in   0.523038 sec =   195779 kbytes/sec
	inside:        102400 kbytes in   0.745649 sec =   137330 kbytes/sec

其他软件

Bonnie ++文件系统I/O性能测试:Bonnie使用标准C库调用来测试文件I/O的速度。
它可以读取和写入块,测试持续数据速率的限制(通常受驱动器或控制器限制),并在文件上进行更新(更好地模拟正常操作条件,并且完全取决于驱动器和操作系统的优化)。