久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

八、IO優(yōu)化(2)IO性能評(píng)估工具

I/O子系統(tǒng)是SQL Server性能的重要組成部分。當(dāng)我們?yōu)镾QL Server配置一臺(tái)新的服務(wù)器,或者添加或修改已有系統(tǒng)的磁盤配置時(shí),都需要判斷I/O子系統(tǒng)的性能。

創(chuàng)新互聯(lián)憑借專業(yè)的設(shè)計(jì)團(tuán)隊(duì)扎實(shí)的技術(shù)支持、優(yōu)質(zhì)高效的服務(wù)意識(shí)和豐厚的資源優(yōu)勢(shì),提供專業(yè)的網(wǎng)站策劃、做網(wǎng)站、網(wǎng)站制作、網(wǎng)站優(yōu)化、軟件開(kāi)發(fā)、網(wǎng)站改版等服務(wù),在成都10多年的網(wǎng)站建設(shè)設(shè)計(jì)經(jīng)驗(yàn),為成都成百上千中小型企業(yè)策劃設(shè)計(jì)了網(wǎng)站。

測(cè)試I/O讀寫(xiě)的塊大小,需要區(qū)分順序讀寫(xiě)與隨機(jī)讀寫(xiě)(sequential/random)。

(1)順序I/O

對(duì)于順序I/O,塊大小應(yīng)當(dāng)包括 8 KB、64 KB、128 KB、256 KB、1024 KB。這是因?yàn)镾QL Server企業(yè)版的“預(yù)讀”Read-ahead 最高可達(dá)到1024KB。測(cè)量結(jié)果主要關(guān)注于磁盤的吞吐量(throughput),計(jì)量單位為MB/s 。

(2)隨機(jī)I/O

對(duì)于隨機(jī)I/O,一般僅關(guān)注于 8 KB的塊。測(cè)量結(jié)果主要關(guān)注于磁盤的尋道能力,計(jì)量單位為I/Os per second(IOPs)。

對(duì)于OLTP,有以下特點(diǎn):

(1)OLTP處理在本質(zhì)上一般是對(duì)數(shù)據(jù)文件(mdf和ndf)隨機(jī)的讀與寫(xiě)。

(2)在大多數(shù)情況下,從本質(zhì)上來(lái)說(shuō),讀的活動(dòng)是持續(xù)的。

(3)對(duì)數(shù)據(jù)文件的寫(xiě)的活動(dòng),主要是檢查點(diǎn)(checkpoint)時(shí)才發(fā)生。檢查點(diǎn)的頻率是由恢復(fù)間隔設(shè)置(recovery interval settings)決定的。

(4)事務(wù)日志的寫(xiě),從本質(zhì)上說(shuō),是連續(xù)的、無(wú)固定大小的,依賴于工作負(fù)荷的性質(zhì)(sector aligned up to 60 KB)。

(5)事務(wù)日志的讀,從本質(zhì)上說(shuō),是連續(xù)的(sector aligned up to 120 KB)。

Microsoft官方針對(duì)SQL Server 2005發(fā)布了一個(gè)最佳實(shí)踐的白皮書(shū),推薦以下3種工具。 http://technet.microsoft.com/zh-cn/library/cc966412.aspx


一、SQLIO

1. 安裝SQLIO

SQLIO是Microsoft官方的硬盤壓力測(cè)試工具,用于測(cè)試磁盤的IOPS(Input/Output per second)值。此工具盡管并不是針對(duì)SQL Server工作模式來(lái)設(shè)計(jì)的,但是仍然可以用來(lái)診斷與SQL Server相關(guān)的一些I/O類型的性能,可以測(cè)量磁盤的IOPs、吞吐量 (MB/s)和延遲時(shí)間。

首先需要到微軟的官網(wǎng)下載 SQLIO Disk Subsystem Benchmark Tool http://www.microsoft.com/en-us/download/details.aspx?id=20163 (本文附件即是)

下載后在運(yùn)行SQLIO.msi文件,進(jìn)入安裝向?qū)А?/p>

八、IO優(yōu)化(2)IO性能評(píng)估工具

八、IO優(yōu)化(2)IO性能評(píng)估工具

八、IO優(yōu)化(2)IO性能評(píng)估工具

八、IO優(yōu)化(2)IO性能評(píng)估工具

八、IO優(yōu)化(2)IO性能評(píng)估工具

2. 配置參數(shù)文件

打開(kāi)安裝所在的文件夾。用文本編輯工具修改param.txt,例如:

f:\testfile.dat 2 0x0 300

#d:\testfile.dat 2 0x0 100

每一行都有4個(gè)參數(shù),分別為:

(1)Path to test file。測(cè)試用的文件和它的完整路徑。上例表示要測(cè)試F盤的IOPS,并在F盤生成一個(gè)名為testfile.dat的測(cè)試文件。

(2)Number of threads (per test file)。測(cè)試時(shí),同時(shí)使用多少個(gè)線程。建議和CPU的數(shù)量一致。

(3)Mask。始終為0x0 。

(4)Size of test file in MB。生成的一個(gè)測(cè)試文件的大小。

3. 運(yùn)行測(cè)試

運(yùn)行“命令提示符”,轉(zhuǎn)到SQLIO的安裝路徑,運(yùn)行以下命令(區(qū)分大小寫(xiě)):

sqlio -kR -s360 -frandom -o8 -b8 -LS -Fparam.txt

詳細(xì)的參數(shù)如下:

-k<R|W>

kind of IO (R=reads, W=writes)

-t<threads>

number of threads

-s<secs>

number of seconds to run

-d<drive1>..<driveN>

use same filename on each drive letter given

-R<drive1>,,<driveN>

raw drive letters/number on which to run

-f<stripe factor>

stripe size in blocks, random, or sequential

-p[I]<cpu affinity>

cpu number for affinity (0 based)(I=ideal)

-a[R[I]]<cpu mask>

cpu mask for (R=roundrobin (I=ideal)) affinity

-o<#outstanding>

depth to use for completion routines

-b<io size(KB)>

IO block size in KB

-i<#IOs/run>

number of IOs per IO run

-m<[C|S]><#sub-blks>

do multi blk IO (C=copy, S=scatter/gather)

-L<[S|P][i|]>

latencies from (S=system, P=processor) timer

-U[p]

report system (p=per processor) utilization

-B<[N|Y|H|S]>

set buffering (N=none, Y=all, H=hdwr, S=sfwr)

-S<#blocks>

start I/Os #blocks into file

-v1.1.1

I/Os runs use same blocks, as in version 1.1.1

-64

use 64 bit memory operations

-F<paramfile>

read parameters from <paramfile>

Defaults:

-kR -t1 -s30 -f64 -b2 -i64 -BN testfile.dat

Maximums:

-t (threads): 256

no. of files, includes -d & -R: 256

filename length: 256

4. 查看結(jié)果

C:\Program Files\SQLIO>sqlio -kR -s360 -frandom -o8 -b8 -LS -Fparam.txt

sqlio v1.5.SG

using system counter for latency timings, 14318180 counts per second

parameter file used: param.txt

file F:\testfile.dat with 2 threads (0-1) using mask 0x0 (0)

2 threads reading for 360 secs from file F:\testfile.dat

using 8KB random IOs

enabling multiple I/Os per thread with 8 outstanding

size of file F:\testfile.dat needs to be: 314572800 bytes

current file size: 0 bytes

need to expand by: 314572800 bytes

expanding F:\testfile.dat ... done.

using specified size: 300 MB for file: F:\testfile.dat

initialization done

CUMULATIVE DATA:

throughput metrics:

IOs/sec: 2209.73

MBs/sec: 73.51

latency metrics:

Min_Latency(ms): 0

Avg_Latency(ms): 0

Max_Latency(ms): 107

histogram:

ms: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24+

%: 98 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

重點(diǎn)關(guān)注輸出結(jié)果中的IOs/sec和MBs/sec的值。

5. 注意事項(xiàng)

(1)虛擬機(jī)中的測(cè)試結(jié)果將是虛假的,因?yàn)樘摂M機(jī)的硬盤映像文件的緩存機(jī)制很復(fù)雜。

(2)如果存儲(chǔ)設(shè)備(SAN或RAID)有緩存,則param.txt文件中Size of test file in MB值必須為讀寫(xiě)緩存的2倍至4倍。

(3)需要使用各種不同的參數(shù)測(cè)試。示例腳本如下:

::Test randmon IO's of 8K

call sqlio -kW -s600 -frandom -o32 -b8 -LS -Fparam.txt

call sqlio -kR -s600 -frandom -o32 -b8 -LS -Fparam.txt

::Test small sequential writes

call sqlio -kW -s60 -fsequential -o1 -b4 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o1 -b8 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o1 -b16 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o1 -b32 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o1 -b64 -LS -Fparam.txt

::Test large sequential read/write

call sqlio -kR -s60 -fsequential -o8 –b8 -LS -Fparam.txt

call sqlio -kR -s60 -fsequential -o8 -b64 -LS -Fparam.txt

call sqlio -kR -s60 -fsequential -o8 -b128 -LS -Fparam.txt

call sqlio -kR -s60 -fsequential -o8 -b256 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o8 –b8 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o8 -b64 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o8 -b128 -LS -Fparam.txt

call sqlio -kW -s60 -fsequential -o8 -b256 -LS -Fparam.txt

二、SQLIOSim

1. 簡(jiǎn)介

SQLIOSim 用于驗(yàn)證加壓后的I/O子系統(tǒng)的基本功能。此工具試圖模擬實(shí)際的 SQL Server I/O 模式(隨機(jī)讀寫(xiě)數(shù)據(jù)文件、連續(xù)讀寫(xiě)日志文件)并檢查結(jié)果的正確性。此工具通常用于隔離 SQL Server 的硬件相關(guān)問(wèn)題。

此工具默認(rèn)隨SQL Server同時(shí)安裝,也可以到官網(wǎng)下載。有2個(gè)文件,一個(gè)是命令行工具,另一個(gè)是圖形界面工具。

八、IO優(yōu)化(2)IO性能評(píng)估工具

2. 圖形界面

(1)配置測(cè)試文件用配置參數(shù)

“以管理員身份運(yùn)行”打開(kāi)圖形工具。首先出現(xiàn)“File and Configuration”界面。默認(rèn)會(huì)為每一個(gè)磁盤驅(qū)動(dòng)器創(chuàng)建2個(gè)文件,分別模擬SQL Server的數(shù)據(jù)文件和日志文件。在下例中,修改其中一個(gè)數(shù)據(jù)文件的配置。為了自動(dòng)刪除測(cè)試文件,我們還要選擇“Delete Files At Shutdown”。

八、IO優(yōu)化(2)IO性能評(píng)估工具

(2)測(cè)試

完成了上述配置,就回到主界面。點(diǎn)一下工具欄的綠色的“Start”開(kāi)始測(cè)試。

八、IO優(yōu)化(2)IO性能評(píng)估工具

測(cè)試完成后,會(huì)出現(xiàn)一個(gè)提示。

八、IO優(yōu)化(2)IO性能評(píng)估工具

本例中出現(xiàn)4個(gè)警告,原因?yàn)椋?/p>

八、IO優(yōu)化(2)IO性能評(píng)估工具

(3)查看結(jié)果

在最終結(jié)果的匯總列表中,找到剛才修改的那個(gè)測(cè)試文件相應(yīng)的結(jié)果。

Test cycle complete

Stopping simulation

Closing file F:\sqliosim.mdx

********** Final Summary for file F:\sqliosim.mdx **********

File Attributes: Compression = No, Encryption = No, Sparse = No

Target IO Duration (ms) = 100, Running Average IO Duration (ms) = 15, Number of times IO throttled = 1071, IO request blocks = 29

Reads = 2460, Scatter Reads = 2372, Writes = 31, Gather Writes = 3238, Total IO Time (ms) = 422837

DRIVE LEVEL: Sector size = 512, Cylinders = 5221, Media type = 0, Sectors per track = 12, Tracks per Cylinders = 63

DRIVE LEVEL: Read cache enabled = No, Write cache enabled = No

DRIVE LEVEL: Read count = 4832, Read time = 20463, Write count = 8953, Write time = 428171, Idle time = 168697, Bytes read = 809762816, Bytes written = 1140978176, Split IO Count = 0, Storage number = 2, Storage manager name = VOLMGR

Closing file F:\sqliosim.ldx

3. 命令行

命令行一共有6個(gè)參數(shù)。詳細(xì)用法見(jiàn) http://support.microsoft.com/kb/231619

-cfg fileOverride the Sqliosim.cfg.ini default configuration file. The SQLIOSim utility returns an error if the utility cannot find the file.
-save fileSave the resulting configuration in the configuration file. You can use this option to create the initial configuration file.
-log fileSpecify the error log file name and the error log file path. The default file name is Sqliosim.log.xml.
-dir dirSet the location to create the data (.mdf) file and the log (.ldf) file. You can run this command multiple times. In most cases, this location is a drive root or a volume mount point. This location can be a long path or a UNC path.
-d secondsSet the duration of the main run. This value excludes the preparation phase and the verification phase.
-size MBSet the initial size of the data file in megabytes (MB). The file can grow up to two times the initial size. The size of the log file is calculated as half the size of the data file. However, the log file cannot be larger than 50 MB.

三、IOMeter

這是一個(gè)第三方的工具,詳情請(qǐng)見(jiàn) http://www.iometer.org/

本文結(jié)語(yǔ):

通過(guò)一些磁盤壓力測(cè)試工具,測(cè)試磁盤的性能。

本文標(biāo)題:八、IO優(yōu)化(2)IO性能評(píng)估工具
轉(zhuǎn)載來(lái)源:http://sd-ha.com/article34/ghdhse.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、做網(wǎng)站、全網(wǎng)營(yíng)銷推廣、網(wǎng)站策劃、移動(dòng)網(wǎng)站建設(shè)、

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司