1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Apress - SQL Server 2008 Query Performance Tuning Distilled (2009)02 ppt

10 533 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề System performance analysis
Định dạng
Số trang 10
Dung lượng 317,77 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

You can also manage the configuration values for iejoanraniaiknu and i]toanran iaiknu by using the ol[_kjbecqnaÍÊÞÊÌi“ÍÊ̜Ăi`Í«ĂœVi`ÕĂi°Í/œÍÊiiÍÌ iÍVœ˜vˆ}ÕĂ>̈œ˜ÍÛ>ÕiÊÍvœĂÍ Ì iÊiÍ«>Ă>“i

Trang 1

Dynamic Management Views

/œÍ}iÌÍ>˜ immediate snapshot of a large amount of data that was formerly available only

ˆ˜Í*iĂvœĂ“>˜ViÍœ˜ˆÌœĂ]Í-+Í-iẶiĂ͘œÜ͜vviĂÊÍ̅iÍÊ>“iÍ`>Ì>͈˜ÌiØ>ÞÍÌ…ĂœÕ}…Í>ÍÊiÌ of

`ޘ>“ˆV͓>˜>}i“i˜ÌÍۈiÜÊÍ­ 6Ê®Í>˜`Í`ޘ>“ˆV͓>˜>}i“i˜ÌÍv՘V̈œ˜ÊÍ­ Ê®°Í/…iÊiÍ>ĂiÍ

iÝÌĂi“iÞÍÕÊivՏ͓iV…>˜ˆÊ“ÊÍvœĂÍV>«ÌÕȘ}Í>Íʘ>«Ê…œÌ͜vÍ̅iÍVÕĂĂi˜ÌÍ«iĂvœĂ“>˜Vi͜vÍޜÕĂÍ

ÊÞÊÌi“°Í½Íˆ˜ÌÜ`ÕViÍÊiÛiĂ>ÍœvÍ̅iÊiÍÌ…ĂœÕ}…œÕÌÍ̅iÍLœœŽ]ÍLÕÌͽÍvœVÕÊ͜˜Í>ÍviÜÍ̅>ÌÍ>ĂiÍ̅iÍ

most important for monitoring performance and for establishing a baseline

/…iÍouo*`i[ko[lanbkni]j_a[_kqjpano view displaysÍ̅iÍ-+Í-iẶiĂÍVœÕ˜ÌiĂÊÍ܈̅ˆ˜Í>Í

µÕiĂÞ]Í>œÜˆ˜}ÍޜÕÍ̜Í>««ÞÍ̅iÍvՏÍÊÌĂi˜}̅͜vÍ/‡-+Í̜Í̅iÍ`>Ì>͈““i`ˆ>ÌiÞ°ÍœĂÍiÝ>“«i]Í

this simple query will return the current value for Hkcejo+oa_:

OAHA?P_jpn[r]hqa

BNKIouo*`i[ko[lanbkni]j_a[_kqjpano

SDANAK>FA?P[J=IA9#IOOMH CB.,,46Cajan]hOp]peope_o#

=J@_kqjpan[j]ia9#Hkcejo+oa_#

/…ˆÊÍĂiÌÕØÊÍ̅iÍÛ>Õi͜vÍ£xÍvœĂ͓ÞÍÊiẶiðÍœĂÍޜÕĂÍÊiẶiĂ]ÍޜսÍ˜ii`Í̜ÍÊÕLÊ̈ÌÕÌiÍ̅iÍ

appropriate server name in the K>FA?P[J=IA comparison

/…iĂiÍ>ĂiÍ>͏>Ă}i͘ՓLiĂ͜vÍ 6ÊÍ>˜`Í ÊÍ̅>ÌÍV>˜ÍLiÍÕÊi`Í̜Í}>̅iĂ͈˜vœĂ“>̈œ˜Í

about the server Rather than cover them all, I’ll introduce one more that you will find yourself

accessing on a regular basis, ouo*`i[ko[s]ep[op]po°Í/…ˆÊÍ 6ÍʅœÜÊÍ>˜Í>}}Ăi}>Ìi`ÍۈiÜ͜vÍ

̅iÍ̅Ăi>`ÊÍ܈̅ˆ˜Í-+Í-iẶiĂÍ̅>ÌÍ>ĂiÍÜ>ˆÌˆ˜}͜˜ÍÛ>ȜÕÊÍĂiʜÕĂViÊ]ÍVœiVÌi`Íʈ˜ViÍ̅i͏>ÊÌÍ

̈“iÍ-+Í-iẶiĂÍÜ>ÊÍÊÌ>ĂÌi`͜ĂÍ̅iÍVœÕ˜ÌiĂÊÍÜiĂiÍĂiÊḭÍ`i˜Ìˆvވ˜}Í̅iÍÌÞ«iÊ͜vÍÜ>ˆÌÊÍ̅>ÌÍ>ĂiÍ

occurring within your system is one of the easiest mechanisms to begin identifying the source

œvÍޜÕĂÍLœÌ̏i˜iVŽÊ°Í9œÕÍV>˜ÍʜĂÌÍ̅iÍ`>Ì>͈˜ÍÛ>ȜÕÊÍÜ>ÞÊ]ÍLÕÌÍvœĂÍ̅iÍvˆĂÊÌÍiÝ>“«i]ͽÍœœŽÍ>ÌÍ

the waits that have the longest current count using this simple query:

OAHA?PPKL$-,%

&

BNKIouo*`i[ko[s]ep[op]po

KN@AN>Us]ep[peia[io@AO?

ˆ}ÕĂiÍӇÓÍ`ˆÊ«>ÞÊÍ̅i͜ÕÌ«Õ̰

Figure 2-2 Output from ouo*`i[ko[s]ep[op]po

You can see not only the cumulative time that particular waits have occurred but also

>ÍVœÕ˜Ì͜vͅœÜ͜vÌi˜Í̅iÞͅ>Ûi͜VVÕĂĂi`Í>˜`Í̅i͓>݈“Õ“Í̈“iÍ̅>ÌÍʜ“i̅ˆ˜}ͅ>`Í̜Í

Ü>ˆÌ°ÍܓͅiĂi]ÍޜÕÍV>˜Íˆ`i˜ÌˆvÞÍ̅iÍÜ>ˆÌÍÌÞ«iÍ>˜`ÍLi}ˆ˜ÍÌÜÕLiʅœœÌˆ˜}°Í"˜i͜vÍ̅i͓œÊÌÍ

Trang 2

Vœ““œ˜ÍÌÞ«iÊ͜vÍÜ>ˆÌÊ͈ÊÍĨ"°ÍvÍޜÕÍÊiiÍ=OUJ?D[EK[?KILHAPEKJ, EK[?KILHAPEKJ, HKCICN, SNEPAHKC, or L=CAEKH=P?D in your top tenÍÜ>ˆÌÍÌÞ«iÊ]ÍޜÕ͓>ÞÍLiÍiÝ«iÈi˜Vˆ˜}ÍĨ"ÍVœ˜Ìi˜Ìˆœ˜]Í

>˜`ÍޜÕ͘œÜ͎˜œÜÍ܅iĂiÍ̜ÍÊÌ>ĂÌÍܜΈ˜}°ÍœĂÍ>͓œĂiÍ`iÌ>ˆi`Í>˜>ÞʈÊ͜vÍÜ>ˆÌÍÌÞ«iÊÍ>˜`ͅœÜÍ ÌœÍÕÊiÍ̅i“Í>ÊÍ>͓œ˜ˆÌœĂˆ˜}Í̜œÍ܈̅ˆ˜Í-+Í-iẶiĂ]ÍĂi>`Í̅i͈VĂœÊœvÌÍ܅ˆÌiÍ«>«iĂͺ-+Í -iẶiĂÍÓôôxÍ7>ˆÌÊÍ>˜`Í+ÕiÕiʻͭdppl6++sss*ie_nkokbp*_ki+pa_djap+lnk`pa_djkh+omh+

^aopln]_pe_a+lanbkni]j_a[pqjejc[s]epo[mqaqao*iolt®°ÍÌ…œÕ}…͈ÌÍÜ>ÊÍÜÈÌÌi˜ÍvœĂÍ-+Í -iẶiĂÍÓôôx]͈Ì͈ÊÍiµÕ>ÞÍ>««ˆV>LiÍ̜Í-+Í-iẶiĂÍÓôôn°

Hardware Resource Bottlenecks

/Þ«ˆV>Þ]Í-+Í-iẶiĂÍ`>Ì>L>Êi performance is affected by stress on the following hardware resources:

Í UÍ ˆÊŽÍĨ"

Í UÍ *ÜViÊʜĂ

Í UÍ iÌܜÎ

-ÌĂiÊÊÍLiޜ˜`Í̅iÍV>«>VˆÌÞ͜vÍ>ͅ>Ă`Ü>ĂiÍĂiʜÕĂViÍvœĂ“ÊÍ>ÍLœÌ̏i˜iVްÍ/œÍ>``ĂiÊÊÍ̅iÍ

œÛiĂ>Í«iĂvœĂ“>˜Vi͜vÍ>ÍÊÞÊÌi“]ÍޜÕ͘ii`Í̜͈`i˜ÌˆvÞÍ̅iÊiÍLœÌ̏i˜iVŽÊ]ÍLiV>ÕÊiÍ̅iÞÍvœĂ“Í̅iÍ limit on overall system performance

Identifying Bottlenecks

/…iĂi͈ÊÍÕÊÕ>ÞÍ>ÍĂi>̈œ˜Ê…ˆ«ÍLiÌÜii˜ÍĂiʜÕĂViÍLœÌ̏i˜iVŽÊ°ÍœĂÍiÝ>“«i]Í>Í«ĂœViÊʜĂÍ LœÌ̏i˜iVŽÍ“>ÞÍLiÍ>ÍÊޓ«Ìœ“ÍœvÍiÝViÊʈÛiÍ«>}ˆ˜}Í­“i“œĂÞÍLœÌ̏i˜iVŽ®ÍœĂÍ>ÍʏœÜÍ`ˆÊŽÍ­`ˆÊŽÍ LœÌ̏i˜iVŽ®°ÍvÍ>ÍÊÞÊÌi“͈Ê͏œÜ͜˜Í“i“œĂÞ]ÍV>Õʈ˜}ÍiÝViÊʈÛiÍ«>}ˆ˜}]Í>˜`ͅ>ÊÍ>ÍʏœÜÍ`ˆÊŽ]Í̅i˜Í

œ˜i͜vÍ̅iÍi˜`ÍĂiÊՏÌÊÍ܈ÍLiÍ>Í«ĂœViÊʜĂÍ܈̅ͅˆ}…ÍṎˆđ>̈œ˜Íʈ˜ViÍ̅iÍ«ĂœViÊʜĂͅ>ÊÍ̜ÍÊ«i˜`Í

̅iÍĂiÊՏÌ>˜Ìͅˆ}…͘ՓLiĂ͜vÍĨ"ÍĂiµÕiÊÌʰÍ,i«>Vˆ˜}Í̅iÍ«ĂœViÊʜĂÍ܈̅Í>Ív>ÊÌiĂ͜˜i͓>Þͅi«Í

>͏ˆÌ̏i]ÍLÕÌ͈ÌÍܜՏ`͘œÌÍLiÍ̅iÍLiÊÌ͜ÛiĂ>ÍʜṎœ˜°Í˜Í>ÍV>Êi͏ˆŽiÍ̅ˆÊ]͈˜VĂi>ʈ˜}͓i“œĂÞ͈ÊÍ>Í

“œĂiÍ>««Ăœ«Ăˆ>ÌiÍʜṎœ˜]ÍLiV>ÕÊi͈ÌÍ܈Í`iVĂi>ÊiÍ«ĂiÊÊÕĂi͜˜Í̅iÍ`ˆÊŽÍ>˜`Í«ĂœViÊʜĂÍ>ÊÍÜi°Í

N Note The most common performance problem is usually I/O, either from memory or from the disk

"˜i͜vÍ̅iÍLiÊÌÍÜ>ÞÊ͜v͏œV>̈˜}Í>ÍLœÌ̏i˜iVŽÍˆÊÍ̜͈`i˜ÌˆvÞÍĂiʜÕĂViÊÍ̅>ÌÍ>ĂiÍÜ>ˆÌˆ˜}ÍvœĂÍ some other resource to complete its operation You can use Performance Monitor counters

œĂÍ 6ÊÍÊÕV…Í>ÊÍouo*`i[ko[s]ep[op]poÍ̜Í}>̅iĂÍ̅>Ì͈˜vœĂ“>̈œ˜°Í/…iÍĂiÊ«œ˜ÊiÍ̈“i͜vÍ>Í request served by a resource includes the time the request had to wait in the resource queue,

>ÊÍÜiÍ>ÊÍ̅iÍ̈“iÍÌ>Ži˜Í̜ÍiÝiVÕÌiÍ̅iÍĂiµÕiÊÌ]ÍʜÍi˜`ÍÕÊiĂÍĂiÊ«œ˜ÊiÍ̈“i͈ÊÍ`ˆĂiV̏ÞÍ«Ăœ«œĂ-tional to the amount of queuing in a system

Trang 3

`ˆÊŽÍÊÕLÊÞÊÌi“Í>Ăi>`Þͅ>ÊÍ«i˜`ˆ˜}Í`ˆÊŽÍĂiµÕiÊÌÊ͜˜ÍˆÌ]Í>͘iÜÍ`ˆÊŽÍĂiµÕiÊÌͅ>ÊÍ̜ÍÜ>ˆÌÍ՘̈Í̅iÍ

«ĂiۈœÕÊÍ`ˆÊŽÍĂiµÕiÊÌÊÍVœ“«iÌi°ÍvÍ̅iÍ̈“iÍÌ>Ži˜ÍLÞÍ>˜Í>ÛiĂ>}iÍ`ˆÊŽÍÌĂ>˜ÊviĂ͈Ê͜˜iÍÊiVœ˜`]Í

̅i˜Í̅i͘iÜÍ`ˆÊŽÍĂiµÕiÊÌͅ>ÊÍ̜ÍÜ>ˆÌÍvœĂÍ>LœÕÌÍÌi˜ÍÊiVœ˜`ÊÍLivœĂiÍ}iÌ̈˜}Í̅iÍ>ÌÌi˜Ìˆœ˜ÍœvÍ̅iÍ

`ˆÊŽÍÊÕLÊÞÊÌi“°Í/…iĂivœĂi]Í̅iÍ̜Ì>ÍĂiÊ«œ˜ÊiÍ̈“i͜vÍ̅iÍ`ˆÊŽÍĂiµÕiÊÌÍ܈ÍLiÍÌi˜ÍÊiVœ˜`ÊÍÜ>ˆÌÍ

̈“i]Í«ÕÊ͜˜iÍÊiVœ˜`Í`ˆÊŽÍÌĂ>˜ÊviĂÍ̈“i°

iÍ>Ü>ĂiÍ̅>ÌÍ̅iÍ>LÊi˜Vi͜vÍ>͵ÕiÕiÍ`œiÊ͘œÌ͓i>˜Í̅>ÌÍ̅iĂi͈Ê͘œÍLœÌ̏i˜iVްÍ7…i˜Í

µÕiÕi͏i˜}̅ÊÍÊÌ>ĂÌÍ}Ü܈˜}]ͅœÜiÛiĂ]͈Ì͈ÊÍ>ÍÊÕĂiÍʈ}˜Í̅>ÌÍ̅iÍÊÞÊÌi“͈Ê͘œÌÍ>LiÍ̜͎ii«ÍÕ«Í

with the demand

œÌÍ>ÍĂiʜÕĂViÊͅ>ÛiÍÊ«iVˆvˆVÍVœÕ˜ÌiĂÊÍ̅>ÌÍʅœÜ͵ÕiՈ˜}͏iÛiÊ]ÍLÕÌ͓œÊÌÍĂiʜÕĂViÊÍ

…>ÛiÍʜ“iÍVœÕ˜ÌiĂÊÍ̅>ÌÍĂi«ĂiÊi˜ÌÍ>˜ÍœÛiĂVœ““ˆÌÌ>ÍœvÍ̅>ÌÍĂiʜÕĂVi°ÍœĂÍiÝ>“«i]͓i“œĂÞÍ

has no such counter, but a large number of hard page faults represents the overcommittal of

«…ÞʈV>Í“i“œĂÞÍ­…>Ă`Í«>}iÍv>ՏÌÊÍ>ĂiÍiÝ«>ˆ˜i`͏>ÌiĂ͈˜Í̅iÍV…>«ÌiĂ͈˜Í̅iÍÊiV̈œ˜Íº*>}iÊĨÊiVÍ VœÕ˜ÌiĂÊÍ̜͈˜`ˆV>ÌiÍ̅i͏iÛiÍœv͵ÕiՈ˜}°ÍœĂÍiÝ>“«i]Í̅i counter L]caHebaAtla_p]j_u

ˆ˜`ˆV>ÌiÊͅœÜ͏œ˜}Í>Í«>}iÍ܈ÍÊÌ>Þ͈˜Í̅iÍLÕvviĂÍ«œœÍ܈̅œÕÌÍLiˆ˜}ÍĂiviĂi˜Vi`°Í/…ˆÊ͈ÊÍ>˜Í

ˆ˜`ˆV>̜Ă͜vͅœÜÍÜiÍ-+Í-iẶiĂ͈ÊÍ>LiÍ̜͓>˜>}i͈ÌÊ͓i“œĂÞ]Íʈ˜ViÍ>͏œ˜}iĂ͏ˆvi͓i>˜ÊÍ̅>ÌÍ

>Í«ˆiVi͜vÍ`>Ì>͈˜Í̅iÍLÕvviĂÍ܈ÍLiÍ̅iĂi]Í>Û>ˆ>Li]ÍÜ>ˆÌˆ˜}ÍvœĂÍ̅i͘iÝÌÍĂiviĂi˜Vi°ÍœÜiÛiĂ]Í

>ÍʅœĂÌiĂ͏ˆvi͓i>˜ÊÍ̅>ÌÍ-+Í-iẶiĂ͈Ê͓œÛˆ˜}Í«>}iÊ͈˜Í>˜`͜ÕÌ͜vÍ̅iÍLÕvviĂ͵ՈVŽÞ]Í«œÊʈLÞÍ

ÊÕ}}iÊ̈˜}Í>͓i“œĂÞÍLœÌ̏i˜iVް

You will see which counters to use inÍ>˜>Þđˆ˜}Íi>V…ÍÌÞ«i͜vÍLœÌ̏i˜iVŽÍʅœĂ̏ް

Bottleneck Resolution

"˜ViÍޜÕͅ>Ûi͈`i˜Ìˆvˆi`ÍLœÌ̏i˜iVŽÊ]ÍޜÕÍV>˜ÍĂiʜÛiÍ̅i“͈˜ÍÌܜÍÜ>ÞÊ\

Í UÍ 9œÕÍV>˜Íˆ˜VĂi>ÊiÍĂiʜÕĂViÍÌ…ĂœÕ}…«Õ̰

Í UÍ 9œÕÍV>˜Í`iVĂi>ÊiÍ̅iÍ>ĂÈÛ>ÍĂ>Ìi͜vÍĂiµÕiÊÌÊÍ̜Í̅iÍĂiʜÕĂVi°

˜VĂi>ʈ˜}Í̅iÍÌ…ĂœÕ}…«ÕÌÍÕÊÕ>ÞÍĂiµÕˆĂiÊÍiÝÌĂ>ÍĂiʜÕĂViÊÍÊÕV…Í>Ê͓i“œĂÞ]Í`ˆÊŽÊ]Í«Ăœ-ViÊʜĂÊ]͜Ă͘iÌܜÎÍ>`>«ÌiĂʰÍ9œÕÍV>˜Í`iVĂi>ÊiÍ̅iÍ>ĂÈÛ>ÍĂ>ÌiÍLÞÍLiˆ˜}͓œĂiÍÊiiV̈ÛiÍ>LœÕÌÍ

̅iÍĂiµÕiÊÌÊÍ̜Í>ÍĂiʜÕĂVi°ÍœĂÍiÝ>“«i]Í܅i˜ÍޜÕͅ>ÛiÍ>Í`ˆÊŽÍÊÕLÊÞÊÌi“ÍLœÌ̏i˜iVŽ]ÍޜÕÍV>˜Í

iˆÌ…iĂ͈˜VĂi>ÊiÍ̅iÍÌ…ĂœÕ}…«ÕÌ͜vÍ̅iÍ`ˆÊŽÍÊÕLÊÞÊÌi“ÍœĂÍ`iVĂi>ÊiÍ̅iÍ>“œÕ˜Ì͜vÍĨ"ÍĂiµÕiÊÌʰ

˜VĂi>ʈ˜}Í̅iÍÌ…ĂœÕ}…«ÕÌ͓i>˜ÊÍ>``ˆ˜}͓œĂiÍ`ˆÊŽÊ͜ĂÍÕ«}Ă>`ˆ˜}Í̜Ív>ÊÌiĂÍ`ˆÊŽÊ°Í iVĂi>Ê-ˆ˜}Í̅iÍ>ĂÈÛ>ÍĂ>Ìi͓i>˜Ê͈`i˜Ìˆvވ˜}Í̅iÍV>ÕÊi͜vͅˆ}…ÍĨ"ÍĂiµÕiÊÌÊÍ̜Í̅iÍ`ˆÊŽÍÊÕLÊÞÊÌi“Í>˜`Í

>««Þˆ˜}ÍĂiʜṎœ˜ÊÍ̜Í`iVĂi>ÊiÍ̅iˆĂ͘ՓLiðÍ9œÕ͓>ÞÍLiÍ>LiÍ̜Í`iVĂi>ÊiÍ̅iÍĨ"ÍĂiµÕiÊÌÊ]Í

vœĂÍiÝ>“«i]ÍLÞÍ>``ˆ˜}Í>««Ăœ«Ăˆ>Ìi͈˜`iÝiÊ͜˜Í>ÍÌ>LiÍ̜͏ˆ“ˆÌÍ̅iÍ>“œÕ˜Ì͜vÍ`>Ì>Í>VViÊÊi`͜ĂÍ

by partitioning a tableÍLiÌÜii˜Í“Տ̈«iÍ`ˆÊŽÊ°

Memory Bottleneck Analysis

Memory can be aÍ«ĂœLi“>̈VÍLœÌ̏i˜iVŽÍLiV>ÕÊiÍ>ÍLœÌ̏i˜iVŽÍˆ˜Í“i“œĂÞÍ܈Í“>˜ˆviÊÌ͜˜Í

œÌ…iĂÍĂiʜÕĂViÊ]Í̜œ°Í/…ˆÊ͈ÊÍ«>Ă̈VՏ>ÏÞÍÌẮiÍvœĂÍ>ÍÊÞÊÌi“ÍẮ˜˜ˆ˜}Í-+Í-iẶiðÍ7…i˜Í-+Í

-iẶiĂÍẮ˜Ê͜ÕÌ͜vÍV>V…iÍ­œĂ͓i“œĂÞ®]Í>Í«ĂœViÊÊÍ܈̅ˆ˜Í-+Í-iẶiĂÍ­V>i`Ílazy writer®Í…>Ê

̜ÍܜÎÍiÝÌi˜ÊˆÛiÞÍ̜͓>ˆ˜Ì>ˆ˜Íi˜œÕ}…ÍvĂii͈˜ÌiØ>Í“i“œĂÞÍ«>}iÊÍ܈̅ˆ˜Í-+Í-iẶiðÍ/…ˆÊÍ

L>VŽÍ̜Í`ˆÊް

Trang 4

SQL Server Memory Management

-+Í-iẶiĂ͓>˜>}iÊ memory for databases, including memory requirements for data and

µÕiĂÞÍiÝiVṎœ˜Í«>˜Ê]͈˜Í>͏>Ă}iÍ«œœÍœv͓i“œĂÞÍV>i`Í̅iÍmemory pool°Í/…i͓i“œĂÞÍ«œœÍ

consists of a collection of 8KB buffers to manage data pages and plan cache pages, free pages,

>˜`ÍʜÍvœĂ̅°Í/…i͓i“œĂÞÍ«œœÍˆÊÍÕÊÕ>ÞÍ̅i͏>Ă}iÊÌÍ«œĂ̈œ˜ÍœvÍ-+Í-iẶiĂ͓i“œĂÞ°Í-+Í -iẶiĂ͓>˜>}iÊ͓i“œĂÞÍLÞÍ}Ü܈˜}͜ĂÍÊ…Ăˆ˜Žˆ˜}͈ÌÊ͓i“œĂÞÍ«œœÍʈđiÍ`ޘ>“ˆV>Þ°

You

canÍVœ˜vˆ}ÕĂiÍ-+Í-iẶiĂÍvœĂÍ`ޘ>“ˆV͓i“œĂÞ͓>˜>}i“i˜Ì͈˜Í-+Í-iẶiĂÍ>˜>}i-“i˜ÌÍ-ÌÕ`ˆœÍ­ -®°ÍœÍ̜Í̅iÍi“œĂÞÍvœ`iĂ͜vÍ̅iÍ-iẶiĂÍ*Ü«iĂ̈iÊÍ`ˆ>œ}ÍLœÝ]Í>ÊÍʅœÜ˜Íˆ˜Í

ˆ}ÕĂiÍӇΰ

Figure 2-3 SQL Server memory configuration

/…iÍ`ޘ>“ˆV͓i“œĂÞÍĂ>˜}i͈ÊÍVœ˜Ì܏i`ÍÌ…ĂœÕ}…ÍÌܜÍVœ˜vˆ}ÕĂ>̈œ˜Í«Ăœ«iĂ̈iÊ\Í

Iejeiqi$I>% and I]teiqi$I>%

Trang 5

Í UÍ Iejeiqi$I>%]Í>ÊœÍŽ˜œÜ˜Í>ÊÍiejoanraniaiknu]ÍܜÎÊÍ>ÊÍ>ÍvœœĂÍÛ>ÕiÍvœĂÍ̅i͓i“œĂÞÍ

«œœ°Í"˜ViÍ̅i͓i“œĂÞÍ«œœÍĂi>V…iÊÍ̅iÍÊ>“iÍʈđiÍ>ÊÍ̅iÍvœœĂÍÛ>Õi]Í-+Í-iẶiĂÍV>˜Í

Vœ˜Ìˆ˜ÕiÍVœ““ˆÌ̈˜}Í«>}iÊ͈˜Í̅i͓i“œĂÞÍ«œœ]ÍLÕÌ͈ÌÍV>˜˜œÌÍLiÍʅẮ˜ŽÍ̜͏iÊÊÍ̅>˜Í

̅iÍvœœĂÍÛ>Õi°Í œÌiÍ̅>ÌÍ-+Í-iẶiĂÍ`œiÊ͘œÌÍÊÌ>ĂÌÍ܈̅Í̅iÍiejoanraniaiknu

con-figuration value but commits memory dynamically, as needed

Í UÍ I]teiqi$I>%]Í>ÊœÍŽ˜œÜ˜Í>Ê i]toanraniaiknu, serves as a ceiling value to limit the

“>݈“Õ“Í}ÜÜ̅͜vÍ̅i͓i“œĂÞÍ«œœ°Í/…iÊiÍVœ˜vˆ}ÕĂ>̈œ˜ÍÊiÌ̈˜}ÊÍÌ>ŽiÍivviVÌ͈““i-diately and do not require a restart

ˆVĂœÊœvÌÍĂiVœ““i˜`ÊÍ̅>ÌÍޜÕÍÕÊiÍ`ޘ>“ˆV͓i“œĂÞÍVœ˜vˆ}ÕĂ>̈œ˜ÍvœĂÍ-+Í-iẶiĂ]Í

where iejoanraniaiknu will be 0 and i]toanraniaiknuÍ܈ÍLiÍ̅i͓>݈“Õ“Í«…ÞʈV>Í

memory of the system, assuming a single instance on the machine You should not run other

“i“œĂއˆ˜Ìi˜ÊˆÛiÍ>««ˆV>̈œ˜Ê͜˜Í̅iÍÊ>“iÍÊiẶiĂÍ>ÊÍ-+Í-iẶiĂ]ÍLÕÌ͈vÍޜÕ͓ÕÊÌ]ÍÍĂiVœ“-mend you first get estimates on how much memory is needed by other applications and then

Vœ˜vˆ}ÕĂiÍ-+Í-iẶiĂÍ܈̅Í>Íi]toanraniaiknu value set to prevent the other applications

vܓÍÊÌ>Ặˆ˜}Í-+Í-iẶiĂ͜v͓i“œĂÞ°Í"˜Í>ÍÊÞÊÌi“Í܅iĂiÍ-+Í-iẶiĂ͈ÊÍẮ˜˜ˆ˜}͜˜ÍˆÌÊ͜ܘ]ÍÍ

«ĂiviĂÍ̜ÍÊiÌÍ̅i͓ˆ˜ˆ“Õ“ÍÊiẶiĂ͓i“œĂÞÍiµÕ>Í̜Í̅i͓>ÝÍÛ>ÕiÍ>˜`Íʈ“«ÞÍ`ˆÊ«>ÌV…Í܈̅Í

`ޘ>“ˆV͓>˜>}i“i˜Ì°Í"˜Í>ÍÊiẶiĂÍ܈͓̅Տ̈«iÍ-+Í-iẶiĂ͈˜ÊÌ>˜ViÊ]ÍޜսÍ˜ii`Í̜Í>`ÕÊÌÍ

̅iÊi͓i“œĂÞÍÊiÌ̈˜}ÊÍ̜Íi˜ÊÕĂiÍi>V…͈˜ÊÌ>˜Viͅ>ÊÍ>˜Í>`iµÕ>ÌiÍÛ>Õi°ÍÕÊÌ͓>ŽiÍÊÕĂiÍޜսÛiÍ

ivÌÍi˜œÕ}…Í“i“œĂÞÍvœĂÍ̅i͜«iĂ>̈˜}ÍÊÞÊÌi“Í>˜`ÍiÝÌiØ>Í«ĂœViÊÊiÊ]Í>ÊÍÜiÍ>Ê͘œ˜‡LÕvviÇ

pool memory (which used to be called IaiPkHa]ra®°

i“œĂÞÍ܈̅ˆ˜Í-+Í-iẶiĂÍV>˜ÍLiÍÜÕ}…ÞÍ`ˆÛˆ`i`͈˜ÌœÍLÕvviĂÍ«œœÍ“i“œĂÞ]Í܅ˆV…ÍĂi«-ĂiÊi˜ÌÊÍ`>Ì>Í«>}iÊÍ>˜`ÍvĂiiÍ«>}iÊ]Í>˜`͘œ˜LÕvviĂ͓i“œĂÞ]Í܅ˆV…ÍVœ˜ÊˆÊÌÊ͜vÍ̅Ăi>`Ê]Í Ê]Í

ˆ˜Ži`ÍÊiẶiĂÊ]Í>˜`̅͜iĂʰÍœÊÌ͜vÍ̅i͓i“œĂÞÍÕÊi`ÍLÞÍ-+Í-iẶiĂÍ}œiÊ͈˜ÌœÍ̅iÍLÕvviĂÍ«œœ°

N Note SQL Server does consume more memory than simply that specified by the i]t[oanran[iaiknu

setting

You can also manage the configuration values for iejoanraniaiknu and i]toanran

iaiknu by using the ol[_kjbecqnaÍÊÞÊÌi“ÍÊ̜Ăi`Í«ĂœVi`ÕĂi°Í/œÍÊiiÍ̅iÍVœ˜vˆ}ÕĂ>̈œ˜ÍÛ>ÕiÊÍvœĂÍ

̅iÊiÍ«>Ă>“iÌiĂÊ]ÍiÝiVÕÌiÍ̅iÍol[_kjbecqna stored procedure as follows:

ata_ol[_kjbecqna#iejoanraniaiknu$I>%#

ata_ol[_kjbecqna#i]toanraniaiknu$I>%#

ˆ}ÕĂiÍӇ{ÍʅœÜÊÍ̅iÍĂiÊՏÌ͜vÍẮ˜˜ˆ˜}Í̅iÊiÍVœ““>˜`ʰ

Figure 2-4 SQL Server memory configuration properties

Trang 6

œÌiÍ̅>ÌÍ̅iÍ`iv>ՏÌÍÛ>ÕiÍvœĂÍ̅iÍiejoanraniaiknu setting is 0MB, and for the i]t oanraniaiknuÍÊiÌ̈˜}͈Ì͈ÊÍÓ£{Ì{nÎỈ{Ì °ÍÊœ]Íi]toanraniaiknu cannot be set to less

̅>˜Í{ °

You can also modify these configuration values using the ol[_kjbecqna stored procedure

œĂÍiÝ>“«i]Í̜ÍÊiÌÍi]toanraniaiknu to 200MB and iejoanraniaiknuÍ̜ͣôô ]ÍiÝiVÕÌiÍ the following set of statements (oap[iaiknu*omh͈˜Í̅iÍ`œÜ˜œ>`®\

QOAi]opan

ATA?ol[_kjbecqna#odks]`r]j_a`klpekj#(#-#

NA?KJBECQNA

ata_ol[_kjbecqna#iejoanraniaiknu$I>%#(-,,

ata_ol[_kjbecqna#i]toanraniaiknu$I>%#(.,,

NA?KJBECQNASEPDKRANNE@A

/…iÍiejoanraniaiknu and i]toanraniaiknu configurations are classified as advanced options By default, the ol[_kjbecqna stored procedure does not affect/display the advanced options Setting odks]`r]j_a`klpekj to - as shown previously enables the ol[_kjbecqna stored procedure to affect/display the advanced options

/…iÍNA?KJBECQNA statement updates the memory configuration values set by ol[_kjbecqna Since ad hoc updates to the system catalog containing the memory configuration values are not recommended, the KRANNE@A flag is used with the NA?KJBECQNA statement to force the memory configuration If you do the memory configuration through Management Studio,

>˜>}i“i˜ÌÍ-ÌÕ`ˆœÍ>Õ̜“>̈V>ÞÍiÝiVÕÌiÊÍ̅iÍNA?KJBECQNASEPDKRANNE@A statement after the configuration setting

˜Íʜ“iÍĂ>ĂiÍVˆĂVՓÊÌ>˜ViÊ]ÍޜÕ͓>Þ͘ii`Í̜Í>œÜÍvœĂÍ-+Í-iẶiĂÍʅ>Ș}Í>ÍÊÞÊÌi“½ÊÍ

œ˜ÍˆÌ°Í œÌ…ÍÊiẶiĂÊÍ>Ăiͅi>ÛÞÍÕÊiĂÊ͜v͓i“œĂÞÍ>˜`Í̅ÕÊ͎ii«Í«Õʅˆ˜}Íi>V…̅͜iĂÍvœĂ͓i“œĂÞ°Í

“i“œĂÞ͓>˜>}i“i˜Ì͜ÛiÅi>`ÍLÞÍVœ˜vˆ}ÕȘ}Í-+Í-iẶiĂÍvœĂÍ>ÍvˆÝi`͓i“œĂÞÍʈđi°ÍœÜiÛiĂ]Í

«i>Êi͎ii«Íˆ˜Í“ˆ˜`Í̅>ÌÍʈ˜ViÍ-+Í-iẶiĂ͈ÊÍ>˜ÍiÝÌĂi“iÞÍĂiʜÕĂVi‡ˆ˜Ìi˜ÊˆÛiÍ«ĂœViÊÊ]͈Ì͈ÊÍ …ˆ}…ÞÍĂiVœ““i˜`i`Í̅>ÌÍޜÕͅ>ÛiÍ>Í`i`ˆV>Ìi`Í-+Í-iẶiĂÍ«Ăœ`ÕV̈œ˜Í“>V…ˆ˜i°

œÜÍ̅>ÌÍޜÕÍ՘`iĂÊÌ>˜`Í-+Í-iẶiĂ͓i“œĂÞ͓>˜>}i“i˜Ì]͏i̽ÊÍVœ˜Êˆ`iĂÍ̅iÍperfor-“>˜ViÍVœÕ˜ÌiĂÊÍޜÕÍV>˜ÍÕÊiÍ̜Í>˜>ÞđiÍÊÌĂiÊÊ͜˜Í“i“œĂÞ]Í>ÊÍʅœÜ˜Íˆ˜Í/>LiÍӇ£°

Table 2-1 Performance Monitor Counters to Analyze Memory Pressure

Object(Instance[,InstanceN]) Counter Description Values

dependent L]cao+oa_ Rate of hard page faults Average

Û>Õi͐Íxô L]caB]qhpo+oa_ Rate of total page faults

its baseline value for trend analysis L]caoEjlqp+oa_ Rate of input page faults

L]caoKqplqp+oa_ Rate of output page faults

Trang 7

Object(Instance[,InstanceN]) Counter Description Values

OMHOanran6>qbbanI]j]can >qbban_]_da

depn]pek

Percentage of requests served out of buffer cache

Average value q 90%

L]caHeba

Atla_p]j_u

/ˆ“i page spends in buffer

Average Û>ÕìÍÎôô

?da_glkejp

L]cao+oa_

PagesÍÜÈÌÌi˜Í̜Í`ˆÊŽÍLÞÍ

V…iVŽ«œˆ˜Ì

Average Û>Õi͐ÍÎô H]vusnepao+oa_ ˆĂÌÞ aged pages flushed

from buffer

Average value < 20 OMHOanran6IaiknuI]j]can IaiknuCn]jpo

Laj`ejc

ՓLiĂ of processes waiting for memory grant

Average value = 0 P]ncapOanran

Iaiknu$G>%

>݈“Õ“ physical

“i“œĂÞÍ-+Í-iẶiĂÍV>˜Í Vœ˜ÊՓi͜˜Í̅iÍLœÝ

of physical memory Pkp]hOanran

Iaiknu$G>%

Physical memory cur-Ăi˜ÌÞÍ>Êʈ}˜i`Í̜Í-+Í

Iaiknu$G>%

that this process has allocated that cannot

be shared with other processes

½Í˜œÜÍÜ>ŽÍޜÕÍÌ…ĂœÕ}…Í̅iÊiÍVœÕ˜ÌiĂÊÍ̜Í}iÌÍ>ÍLiÌÌiĂ͈`i> of what you can use them for

Available Bytes

/…iÍ=r]eh]^ha>upaoÍVœÕ˜ÌiĂÍĂi«ĂiÊi˜ÌÊÍvĂiiÍ«…ÞʈV>Í“i“œĂÞ͈˜Í̅iÍÊÞÊÌi“°ÍœĂÍ}œœ`Í«iĂ-vœĂ“>˜Vi]Í̅ˆÊÍVœÕ˜ÌiĂÍÛ>ÕiÍʅœÕ`͘œÌÍLiÍ̜œÍœÜ°ÍvÍ-+Í-iẶiĂ͈ÊÍVœ˜vˆ}ÕĂi`ÍvœĂÍ`ޘ>“ˆVÍ

memory usage, then this value will be controlled by calls to a Windows API that determines

-+Í-iẶiĂ͓i“œĂÞ͘œÌÍV…>˜}ˆ˜}͈˜`ˆV>ÌiÊÍ̅>ÌÍ̅iÍÊiẶiĂ͈ÊÍ՘`iĂÍÊiÛiĂi͓i“œĂÞÍÊÌĂiÊʰ

Pages/sec and Page Faults/sec Counters

/œÍ՘`iĂÊÌ>˜`Í̅i͈“«œĂÌ>˜Vi͜vÍ̅iÍL]cao+oa_ and L]caB]qhpo+oa_ counters, you first need

to learn about page faults A page fault occurs when a process requires code or data that is not

in its working setÍ­ˆÌÊÍÊ«>Vi͈˜Í«…ÞʈV>Í“i“œĂÞ®°ÍÌ͓>Þ͏i>`Í̜Í>ÍʜvÌÍ«>}iÍv>ՏÌ͜ĂÍ>ͅ>Ă`Í«>}iÍ

fault If the faulted page is found elsewhere in physical memory, then it is called a soft page

fault A hard page fault͜VVÕĂÊÍ܅i˜Í>Í«ĂœViÊÊÍĂiµÕˆĂiÊÍVœ`i͜ĂÍ`>Ì>Í̅>Ì͈Ê͘œÌ͈˜ÍˆÌÊÍܜΈ˜}Í

ÊiÌ͜ĂÍiÊi܅iĂi͈˜Í«…ÞʈV>Í“i“œĂÞÍ>˜`͓ÕÊÌÍLiÍĂiÌÈiÛi`ÍvܓÍ`ˆÊް

/…iÍÊ«ii`͜vÍ>Í`ˆÊŽÍ>VViÊÊ͈Ê͈˜Í̅i͜Ă`iĂ͜v͓ˆˆÊiVœ˜`Ê]Í܅iĂi>ÊÍ>͓i“œĂÞÍ>VViÊÊ͈Ê͈˜Í

̅i͜Ă`iĂ͜v͘>˜œÊiVœ˜`ʰÍ/…ˆÊͅÕ}iÍ`ˆvviĂi˜Vi͈˜Í̅iÍÊ«ii`ÍLiÌÜii˜Í>Í`ˆÊŽÍ>VViÊÊÍ>˜`Í>͓i“-œĂÞÍ>VViÊÊ͓>ŽiÊÍ̅iÍivviVÌ͜vͅ>Ă`Í«>}iÍv>ՏÌÊÍʈ}˜ˆvˆV>˜ÌÍVœ“«>Ăi`Í̜Í̅>Ì͜vÍʜvÌÍ«>}iÍv>ՏÌʰ

/…iÍL]cao+oa_ÍVœÕ˜ÌiĂÍĂi«ĂiÊi˜ÌÊÍ̅i͘ՓLiĂ͜vÍ«>}iÊÍĂi>`Ívܓ͜ĂÍÜÈÌÌi˜Í̜Í`ˆÊŽÍ«iĂÍ

ÊiVœ˜`Í̜ÍĂiʜÛiͅ>Ă`Í«>}iÍv>ՏÌʰÍ/…iÍL]caB]qhpo+oa_ performance counter indicates the

total page faults per second—soft page faults plus hard page faults—handled by the system

Trang 8

>Ă`Í«>}iÍv>ՏÌÊ]͈˜`ˆV>Ìi`ÍLÞÍL]cao+oa_, should not be consistently high If this counter

ˆÊÍVœ˜ÊˆÊÌi˜ÌÞÍÛiĂÞͅˆ}…]Í̅i˜Í-+Í-iẶiĂ͈ÊÍ«ĂœL>LÞÍÊÌ>Ặˆ˜}̅͜iĂÍ>««ˆV>̈œ˜Ê°Í/…iĂiÍ>Ăi͘œÍ hard and fast numbers for what indicates a problem, because these numbers will vary widely LiÌÜii˜ÍÊÞÊÌi“ÊÍL>Êi`͜˜Í̅iÍ>“œÕ˜ÌÍ>˜`ÍÌÞ«i͜v͓i“œĂÞÍ>ÊÍÜiÍ>ÊÍ̅iÍÊ«ii`͜vÍ`ˆÊŽÍ>VViÊÊÍ

on the system

If the L]cao+oa_ counter isÍÛiĂÞͅˆ}…]Í̅i˜ÍޜÕÍV>˜ÍLĂi>ŽÍˆÌÍի͈˜ÌœÍL]caoEjlqp+oa_ and L]caoKqplqp+oa_:

Í UÍ L]caoEjlqp+oa_: An application will wait only on an input page, not on an output page

Í UÍ L]caoKqplqp+oa_: Page output will stress the system, but an application usually does not see this stress Pages output are usually represented by the application’s dirty

«>}iÊÍ̅>Ì͘ii`Í̜ÍLiÍL>VŽi`͜ÕÌÍ̜Í̅iÍ`ˆÊްÍL]caoKqplqp+oa_ is an issue only when

`ˆÊŽÍœ>`ÍLiVœ“iÍ>˜ÍˆÊÊÕi°

Êœ]ÍV…iVŽÍLnk_aoo6L]caB]qhpo+oa_Í̜Ívˆ˜`͜ÕÌÍ܅ˆV…Í«ĂœViÊÊ͈ÊÍV>Õʈ˜}ÍiÝViÊʈÛiÍ paging in case of high L]cao+oa_°Í/…iÍLnk_aoo object is the system component that provides performance data for the processes running on the system, which are individually represented

by their corresponding instance name

œĂÍiÝ>“«i]Í̅iÍ-+Í-iẶiĂÍ«ĂœViÊÊ͈ÊÍĂi«ĂiÊi˜Ìi`ÍLÞÍ̅iÍomhoanrn instance of the Lnk_aoo͜LiV̰͈}…͘ՓLiĂÊÍvœĂÍ̅ˆÊÍVœÕ˜ÌiĂÍÕÊÕ>ÞÍ`œÍ˜œÌ͓i>˜Í“ÕV…Í՘iÊÊÍL]cao+oa_ is high L]caB]qhpo+oa_ can range all over the spectrum with normal application behavior, with Û>ÕiÊÍvܓÍôÍ̜ͣ]ôôôÍ«iĂÍÊiVœ˜`ÍLiˆ˜}Í>VVi«Ì>Li°Í/…ˆÊÍi˜ÌˆĂiÍ`>Ì>ÍÊiÌ͓i>˜ÊÍ>ÍL>Êiˆ˜i͈ÊÍ iÊÊi˜Ìˆ>Í̜Í`iÌiӈ˜iÍ̅iÍiÝ«iVÌi`͘œĂ“>ÍLi…>ۈœĂ°

Buffer Cache Hit Ratio

/…iÍbuffer cache is the pool of buffer pages into which data pages are read, and it is often the

Lˆ}}iÊÌÍ«>ĂÌ͜vÍ̅iÍ-+Í-iẶiĂ͓i“œĂÞÍ«œœ°Í/…ˆÊÍVœÕ˜ÌiĂÍÛ>ÕiÍʅœÕ`ÍLiÍ>Êͅˆ}…Í>ÊÍ«œÊʈLi]Í iÊ«iVˆ>ÞÍvœĂÍ"/*ÍÊÞÊÌi“ÊÍ̅>ÌÍʅœÕ`ͅ>ÛiÍv>ˆĂÞÍĂi}ˆ“i˜Ìi`Í`>Ì>Í>VViÊÊ]Í՘ˆŽiÍ>ÍÜ>Ăi-…œÕÊi͜ĂÍĂi«œĂ̈˜}ÍÊÞÊÌi“°ÍÌ͈ÊÍiÝÌĂi“iÞÍVœ““œ˜Í̜Ívˆ˜`Í̅ˆÊÍVœÕ˜ÌiĂÍÛ>ÕiÍ>Ê͙™Í«iĂVi˜ÌÍ

or more for most production servers A low >qbban_]_dadepn]pek value indicates that few requests could be served out of the buffer cache, with the rest of the requests being served vܓÍ`ˆÊް

7…i˜Í̅ˆÊͅ>««i˜Ê]ÍiˆÌ…iĂÍ-+Í-iẶiĂ͈ÊÍÊ̈ÍÜ>ӈ˜}Íի͜ĂÍ̅i͓i“œĂÞÍĂiµÕˆĂi“i˜Ì͜vÍ

̅iÍLÕvviĂÍV>V…i͈Ê͓œĂiÍ̅>˜Í̅i͓>݈“Õ“Í“i“œĂÞÍ>Û>ˆ>LiÍvœĂ͈ÌÊÍ}ÜÜ̅°ÍvÍ̅ˆÊ͈ÊÍVœ˜ÊˆÊ-tently low, you should consider getting more memory for the system

Page Life Expectancy

L]caHebaAtla_p]j_u indicates how long a page will stay in the buffer pool without being ref-iĂi˜Vi`°Íi˜iĂ>Þ]Í>͏œÜ͘ՓLiĂÍvœĂÍ̅ˆÊÍVœÕ˜ÌiĂ͓i>˜ÊÍ̅>ÌÍ«>}iÊÍ>ĂiÍLiˆ˜}ÍĂi“œÛi`ÍvÜ“Í the buffer, lowering the efficiency of the cache and indicating the possibility of memory pres-ÊÕĂi°Í"˜ÍĂi«œĂ̈˜}ÍÊÞÊÌi“Ê]Í>Ê͜««œÊi`Í̜Í"/*ÍÊÞÊÌi“Ê]Í̅ˆÊ͘ՓLiĂ͓>ÞÍĂi“>ˆ˜Í>ÌÍ>͏œÜiĂÍ Û>ÕiÍʈ˜Vi͓œĂiÍ`>Ì>͈ÊÍ>VViÊÊi`ÍvܓÍĂi«œĂ̈˜}ÍÊÞÊÌi“ʰÍÍĂi>ʜ˜>LiÍÛ>ÕiÍ̜ÍiÝ«iVÌÍ̜ÍÊiiÍ …iĂi͈ÊÍÎôôÍÊiVœ˜`Ê͜Ă͓œĂi°

Trang 9

Checkpoint Pages/sec

/…iÍ?da_glkejpL]cao+oa_ÍVœÕ˜ÌiĂÍĂi«ĂiÊi˜ÌÊÍ̅i͘ՓLiĂ͜vÍ«>}iÊÍ̅>ÌÍ>Ăi͓œÛi`Í̜Í`ˆÊŽÍLÞÍ

>ÍV…iVŽ«œˆ˜Ì͜«iĂ>̈œ˜°Í/…iÊi͘ՓLiĂÊÍʅœÕ`ÍLiÍĂi>̈ÛiÞ͏œÜ]ÍvœĂÍiÝ>“«i]͏iÊÊÍ̅>˜ÍÎôÍ«iĂÍ

ÊiVœ˜`ÍvœĂ͓œÊÌÍÊÞÊÌi“ʰÍͅˆ}…iĂ͘ՓLiĂ͓i>˜Ê͓œĂiÍ«>}iÊÍ>ĂiÍLiˆ˜}͓>Îi`Í>ÊÍ`ˆĂÌÞ͈˜Í̅iÍ

V>V…i°ÍÍ`ˆĂÌÞÍ«>}i͈Ê͜˜iÍ̅>Ì͈Ê͓œ`ˆvˆi`Í܅ˆi͈˜Í̅iÍLÕvviðÍ7…i˜ÍˆÌ½Ê͓œ`ˆvˆi`]͈̽Ê͓>Îi`Í

>ÊÍ`ˆĂÌÞÍ>˜`Í܈Í}iÌÍÜÈÌÌi˜ÍL>VŽÍ̜Í̅iÍ`ˆÊŽÍ`ÕȘ}Í̅i͘iÝÌÍV…iVŽ«œˆ˜Ì°Íˆ}…iĂÍÛ>ÕiÊ͜˜Í̅ˆÊÍ

counter indicate a larger number of writes occurring within the system, possibly indicative of

Ĩ"Í«ĂœLi“ʰ

Lazy writes/sec

/…iÍH]vusnepao+oa_ counter records the number of buffers written each second by the buffer

“>˜>}iĂ½Ê͏>đÞÍÜÈÌiÍ«ĂœViÊʰÍ/…ˆÊÍ«ĂœViÊÊ͈ÊÍ܅iĂiÍ̅iÍ`ˆĂÌÞ]Í>}i`ÍLÕvviĂÊÍ>ĂiÍĂi“œÛi`ÍvܓÍ

the buffer by a system process that frees the memory up for other uses A dirty, aged buffer

ˆÊ͜˜iÍ̅>Ìͅ>ÊÍV…>˜}iÊÍ>˜`͘ii`ÊÍ̜ÍLiÍÜÈÌÌi˜Í̜Í̅iÍ`ˆÊް͈}…iĂÍÛ>ÕiÊ͜˜Í̅ˆÊÍVœÕ˜ÌiĂÍ

«œÊʈLÞ͈˜`ˆV>ÌiÍĨ"͈ÊÊÕiÊ͜ĂÍiÛi˜Í“i“œĂÞÍ«ĂœLi“ʰÍ/…iÍH]vusnepao+oa_ values should

consistently be less than 20 for the average system

Memory Grants Pending

/…iÍIaiknuCn]jpoLaj`ejc counter represents the number of processes pending for a

mem-œĂÞÍ}Ă>˜ÌÍ܈̅ˆ˜Í-+Í-iẶiĂ͓i“œĂÞ°ÍvÍ̅ˆÊÍVœÕ˜ÌiĂÍÛ>Õi͈Êͅˆ}…]Í̅i˜Í-+Í-iẶiĂ͈ÊÍʅœĂÌ͜vÍ

“i“œĂÞ°Í1˜`iĂ͘œĂ“>ÍVœ˜`ˆÌˆœ˜Ê]Í̅ˆÊÍVœÕ˜ÌiĂÍÛ>ÕiÍʅœÕ`ÍVœ˜ÊˆÊÌi˜ÌÞÍLiÍôÍvœĂ͓œÊÌÍ«Ăœ-duction servers

Another way to retrieve this value, on the fly, is to run queries against theÍ 6Íouo*`i[

ata_[mqanu[iaiknu[cn]jpo A jqhh value in the column cn]jp[peia indicates that the process

ˆÊÍÊ̈ÍÜ>ˆÌˆ˜}ÍvœĂÍ>͓i“œĂÞÍ}Ă>˜Ì°Í/…ˆÊ͈Ê͜˜i͓i̅œ`ÍޜÕÍV>˜ÍÕÊiÍ̜ÍÌÜÕLiʅœœÌ͵ÕiĂÞÍ

̈“iœÕÌÊÍLÞ͈`i˜Ìˆvވ˜}Í̅>ÌÍ>͵ÕiĂÞÍ­œĂ͵ÕiÈiʮ͈ÊÍÜ>ˆÌˆ˜}͜˜Í“i“œĂÞ͈˜ÍœĂ`iĂÍ̜ÍiÝiVÕÌi°

Target Server Memory (KB) and Total Server Memory (KB)

P]ncapOanranIaiknu$G>% indicatesÍ̅iÍ̜Ì>Í>“œÕ˜Ì͜vÍ`ޘ>“ˆV͓i“œĂÞÍ-+Í-iẶiĂ͈ÊÍ

willing to consume Pkp]hOanranIaiknu$G>% indicates the amount of memory currently

>Êʈ}˜i`Í̜Í-+Í-iẶiðÍ/…iÍPkp]hOanranIaiknu$G>% counter value can be very high if the

ÊÞÊÌi“͈ÊÍ`i`ˆV>Ìi`Í̜Í-+Í-iẶiðÍvÍPkp]hOanranIaiknu$G>% is much less than P]ncap

OanranIaiknu$G>%]Í̅i˜ÍiˆÌ…iĂÍ̅iÍ-+Í-iẶiĂ͓i“œĂÞÍĂiµÕˆĂi“i˜Ì͈Ê͏œÜ]Í̅iÍi]toanran

iaiknuÍVœ˜vˆ}ÕĂ>̈œ˜Í«>Ă>“iÌiĂ͜vÍ-+Í-iẶiĂ͈ÊÍÊiÌÍ>ÌÍ̜œÍœÜÍ>ÍÛ>Õi]͜ĂÍ̅iÍÊÞÊÌi“͈Ê͈˜Í

warm-up

phase°Í/…iÍÜ>Ӈիͫ…>Êi͈ÊÍ̅iÍ«iȜ`Í>vÌiĂÍ-+Í-iẶiĂ͈ÊÍÊÌ>ĂÌi`Í܅i˜Í̅iÍ`>Ì>-L>ÊiÍÊiẶiĂ͈Ê͈˜Í̅iÍ«ĂœViÊÊ͜vÍiÝ«>˜`ˆ˜}͈ÌÊ͓i“œĂÞÍ>œV>̈œ˜Í`ޘ>“ˆV>ÞÍ>Ê͓œĂiÍ`>Ì>Í

sets are accessed, bringing more data pages into memory

9œÕÍV>˜ÍVœ˜vˆĂ“Í>͏œÜ͓i“œĂÞÍĂiµÕˆĂi“i˜ÌÍvܓÍ-+Í-iẶiĂÍLÞÍ̅iÍ«ĂiÊi˜Vi͜vÍ>͏>Ă}iÍ

˜Õ“LiĂ͜vÍvĂiiÍ«>}iÊ]ÍÕÊÕ>ÞÍx]ôôô͜Ă͓œĂi°

Memory Bottleneck Resolutions

When there is high stress on memory, indicated by a large number of hard page faults, you can ĂiʜÛi͓i“œĂÞÍLœÌ̏i˜iVŽÍÕʈ˜}Í̅iÍvœÜV…>ĂÌÍʅœÜ˜Íˆ˜Íˆ}ÕĂiÍӇx°

Trang 10

Figure 2-5 Memory bottleneck resolution chart

ÍviÜ͜vÍ̅iÍVœ““œ˜ÍĂiʜṎœ˜ÊÍvœĂ͓i“œĂÞÍLœÌ̏i˜iVŽÊÍ>ĂiÍ>ÊÍvœœÜÊ\

Í UÍ "«Ìˆ“ˆđˆ˜}Í>««ˆV>̈œ˜ÍܜΏœ>`

Í UÍ œV>̈˜}͓œĂi͓i“œĂÞÍ̜Í-+Í-iẶiĂ

Í UÍ ˜VĂi>ʈ˜}ÍÊÞÊÌi“Í“i“œĂÞ

Í

Í

Í UÍ 1ʈ˜}͓i“œĂÞÍLiޜ˜`Í{ Í܈̅ˆ˜ÍÎӇLˆÌÍ-+Í-iẶiĂ

i̽ÊÍÌ>ŽiÍ>͏œœŽÍ>ÌÍi>V…ÍœvÍ̅iÊi͈˜ÍÌÕØ°

...

>`ấvè/iiịôấếấế>ịèi>}iấèôèv-+-iii? ?-+  -ii>>}iấiịLị}ĩ}ấ}èấiịôấi`ị>V>ị

You

canVv}ếi-+-iiv`ị>Viị>>}ii? ?-+ -ii>>}i-i? ?-? ?ế`ư -? ?èèiiịv`ivèi-ii*ôièiấ`>}Lí]>ấấĩ...

èiiấếViấ]è/ấấô>èVế>ịèiv>ấịấèi }-+ -ii7i-+

-iiấếèvV>Viưiịđ]>ôViấấĩ? ?-+ -iiưV>i`lazy writerđ>ấ

èĩiíèiấiịè>è>iế}viièi>iịô>}iấĩ? ?-+ -ii/ấ

L>Vè`ấ

Ngày đăng: 17/12/2013, 02:15

TỪ KHÓA LIÊN QUAN