服务器IO测试利器--SQLIO

Posted on 2012-08-10 14:06  高老爷空间  阅读(965)  评论(0编辑  收藏  举报

我有过这样的经历:公司要上一个新的系统,为了节省成本,不知道公司从哪里搞过来了一台过旧的服务器作为数据库服务器使用,由于刚刚到公司,不好意思提出异议,只能忍心接受。时间长了,发现服务器性能跟不上(当然不是数据库本省的问题)。拼命地搜集哪里偏慢的证据。要个给你服务器的人或开发应用的人理论。

收集的工具不外乎是微软的Perfermance Counter.现在向大家介绍一个好用的磁盘测试工具,有了证据就不拍扯皮了。

SQLIO:

下载地址:http://www.microsoft.com/en-us/download/details.aspx?id=20163

使用方法介绍:

1 安装SQLIO

2 修改参数文件:将测试文件存放于特定目录(要测试的磁盘上)例如:

c:\sqlio_test.dat 4 0x0 100

d:\sqlio_test.dat 4 0x0 100

原版的解释如下(看不懂英文的人就要吃亏了):

The options on each line of the param.txt file are as follows: 

  • <Path to test file> Full path and name      of the test file to be used.  
  • <Number of threads (per test file)> Recommend      setting this equal to the number of CPUs on the host.  Possible exception is when testing many      paths at one time.  See note above.  
  • <Mask > Set to 0x0
  • <Size of test file in MB> Ideally,      this should be large enough so that the test file will be larger than any      cache resident on the SAN (or RAID controller).  Two to four times the size of any cache      allocated is a good rule of thumb to follow.

3 编辑BAT文件。原版微软的例程如下:

sqlio -kW -s10 -frandom -o8 -b8 -LS -Fparam.txt

timeout /T 60

sqlio -kW -s360 -frandom -o8 -b64 -LS -Fparam.txt

timeout /T 60

sqlio -kW -s360 -frandom -o8 -b128 -LS -Fparam.txt

timeout /T 60

sqlio -kW -s360 -frandom -o8 -b256 -LS -Fparam.txt

timeout /T 60

相关的叙述 解释 :

 

Option

Description

-o

Specify the number of   outstanding I/O requests.  Increasing the queue depth may result in a   higher total throughput. However, increasing this number too high may result   in problems (described in more detail below).    Common values for this are 8, 32, and 64.

-LS

Capture disk latency   information.  Capturing latency data is   recommended when testing a system.  

-k

Specify either R or W   (read or write).

-s

Duration of test   (seconds).  For initial tests, running   for 5-10 minutes per I/O size is recommended to get a good idea of I/O   performance.

-b

Size of the IO request in   bytes.

-f

Type of IO to issue.  Either ‘random’ or ‘sequential’.

-F

Name of the file which   will contain the test files to run SQLIO against.

4 运行。结果中的内容很清楚了,不一一介绍了。

详细的说明参考安装后的Using SQLIO 一文

 

 

Copyright © 2024 高老爷空间
Powered by .NET 8.0 on Kubernetes