SQLIO 下载地址:SQLIO Disk Subsystem Benchmark Tool
默认目录:C:\Program Files\SQLIO
以命令行运行,进入到安装目录(C:\Program Files\SQLIO)运行 SQLIO 执行测试
#常用参数
o The -k option to specify the I/O operation type (read or write) o The -s option to specify the test duration in seconds o The -f option to specify the type of I/O access (sequential or random) o The -o option to specify the number of outstanding requests o The -b option to specify the size of the I/O request in bytesblock size o The -LS option to capture the disk latency option o The -F option to specify the name of the file which contain the test files to run SQLIO against
#测试参考
sqlio -kW -s300 -frandom -o32 -b4 -LS -Fparam.txt sqlio -kR -s300 -frandom -o32 -b4 -LS -Fparam.txt sqlio -kW -s300 -fsequential -o32 -b4 -LS -Fparam.txt sqlio -kR -s300 -fsequential -o32 -b4 -LS -Fparam.txt sqlio -kW -s300 -frandom -o32 -b8 -LS -Fparam.txt sqlio -kR -s300 -frandom -o32 -b8 -LS -Fparam.txt sqlio -kW -s300 -fsequential -o32 -b8 -LS -Fparam.txt sqlio -kR -s300 -fsequential -o32 -b8 -LS -Fparam.txt sqlio -kW -s300 -frandom -o32 -b64 -LS -Fparam.txt sqlio -kR -s300 -frandom -o32 -b64 -LS -Fparam.txt sqlio -kW -s300 -fsequential -o32 -b64 -LS -Fparam.txt sqlio -kR -s300 -fsequential -o32 -b64 -LS -Fparam.txt sqlio -kW -s300 -frandom -o32 -b128 -LS -Fparam.txt sqlio -kR -s300 -frandom -o32 -b128 -LS -Fparam.txt sqlio -kW -s300 -fsequential -o32 -b128 -LS -Fparam.txt sqlio -kR -s300 -fsequential -o32 -b128 -LS -Fparam.txt
以下用命令行批量执行,在安装目录下创建下列文件及其内容
#结果输出文件:result.txt
#参数文件 ( 4线程10GB ) :param.txt
d:\sqliotestfile.dat 4 0x0 10000
#bat批量执行文件:ExecuteCMD.bat
echo ----------------------------sqlio -kW -s300 -frandom -o32 -b4 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -frandom -o32 -b4 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -frandom -o32 -b4 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -frandom -o32 -b4 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kW -s300 -fsequential -o32 -b4 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -fsequential -o32 -b4 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -fsequential -o32 -b4 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -fsequential -o32 -b4 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kW -s300 -frandom -o32 -b8 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -frandom -o32 -b8 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -frandom -o32 -b8 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -frandom -o32 -b8 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kW -s300 -fsequential -o32 -b8 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -fsequential -o32 -b8 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -fsequential -o32 -b8 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -fsequential -o32 -b8 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kW -s300 -frandom -o32 -b64 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -frandom -o32 -b64 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -frandom -o32 -b64 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -frandom -o32 -b64 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kW -s300 -fsequential -o32 -b64 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -fsequential -o32 -b64 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -fsequential -o32 -b64 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -fsequential -o32 -b64 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kW -s300 -frandom -o32 -b128 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -frandom -o32 -b128 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -frandom -o32 -b128 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -frandom -o32 -b128 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kW -s300 -fsequential -o32 -b128 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kW -s300 -fsequential -o32 -b128 -LS -Fparam.txt>>result.txt echo. >>result.txt echo. >>result.txt echo ----------------------------sqlio -kR -s300 -fsequential -o32 -b128 -LS -Fparam.txt----------------------->>result.txt echo. >>result.txt sqlio -kR -s300 -fsequential -o32 -b128 -LS -Fparam.txt>>result.txt
更多详细参数:
Option |
Description |
-k |
-k<R|W> 指定测试 I/O 的种类:读或写 -kR 测试读 -kW 测试写 |
-s |
-s<secs> 指定测试执行时间,单位:秒 -s360 测试 360 秒 通常建议运行 5-10 分钟以得到更合理的结果。 |
-f |
-f<stripe factor> 指定 I/O 条带测试方式 -fsequential 使用顺序方式 -frandom 使用随机方式 -f8 StripeSize = 8 * (-b 参数) 条带(Stripe)代表着磁盘中最小的分区。 |
-o |
-o<#outstanding> 指定未处理 I/O 请求数量,也就是请求 Queue 的深度 -o8 每个 Queue 中有 8 个未处理的 I/O 请求 通过指定不同的数值以改变总体吞吐率,常用数值为 8, 32, 64。 |
-b |
-b<size(KB)> 指定 I/O 请求块的尺寸,单位 KBytes -b8 使用 8 KBytes 的请求块大小 |
-L |
-L<S|P> 指定捕获延迟信息 -LS 延迟信息来自系统计数器 S = System Timer -LP 延迟信息来自处理器计数器 P = Processor Timer |
-t |
-t<threads> 指定线程的数量,最大值 256 -t8 使用 8 个线程进行测试 |
-B |
-B<N|Y|H|S> 设置缓存(Buffering) -BN N=none -BY Y=all -BH H=hdwr -BS S=sfwr |
-F |
-F<paramfile> 指定测试参数文件位置,文件名最大长度 256 -Fparam.txt 从当前运行目录中的 param.txt 文件中读取参数 |
-d |
-d<DriveLetter> 指定测试的磁盘驱动器,最多指定 256 个盘符 -dD 测试 D 盘 -dDE 测试 D 盘和 E 盘 |
-p |
-p<I> 指定 CPU Affinity -p0 affinity on cpu number 0 -pI0 ideal affinity on cpu number 0 CPU Affinity 允许进行在特定的处理器中运行。 |
-a |
-a<R|I> 指定 CPU Affinity 掩码 -a3 affnity mask is 0x3(3) -aR3 affinity mask is 0x3(3) with round robin -aRI3 ideal affinity mask is 0x3(3) with round robin |
-i |
-i<#IO/run> 指定每次 IO 测试中执行 IO 的次数 -i8 8 IOs per run |
-m |
-m<[C|S]><#sub-blks> do multi blk IO (C=copy, S=scatter/gather) |
-S |
-S<#blocks> start I/O #blocks into file |
参考文档:Performance Guidance for SQL Server in Windows Azure Virtual Machines