Вы находитесь на странице: 1из 354

Microsoft

Microsoft ,
Team
.

PERFORMANCE
TESTING
MICROSOFr

.NET
WEB APPLICATION

.-

Microsoft ACE Team

Microsoft Press

WEB-
MICROSOFT

.NET

Microsoft ACE Team


2003

ISi,

004.45
32.973.26-018.2
59

59

Microsoft Corporation
Web- Microsoft .NET/
. . .: - , 2003.
- 352 .: .
ISBN 5-7502-0224-0
Microsoft, Web- Web-, Microsoft
Application Consulting and Engineering (ACE) Team (
Microsoft). ,
Web-.
, , Microsoft IIS, ASP.NET, SQL-.
, Microsoft , .
10 , -, .
004.45
32.973.26-018.J
Microsoft Corporation, , , .
Application Expert Compuware
Corporation. ActiveX, BackOffice, BizTalk, JScript, Microsoft, Microsoft Press,
.Net, PowerPoint, Visual Basic, Visual C++, Visual C#, Visual InterDev, Visual
) + + , Visual SourceSafe, Visual Studio, Win32, Windows Windows NT Microsoft / .
.
, , ,
, , , .

ISBN 0-7356-1538-1 (.)


ISBN 5-7502-0224-0

,
Microsoft Corporation, 2003

;S

, Microsoft Corporation,
2003

, - , 2003


-
-



.NET
.NET
.NET
\/51
UDDI
Web- XML
Web-

Web-
Web-








...

XI
XII
XII
XIII
XIII
XIV
XV
XVI11

1
1
3
4
5
7
8
8
9
10
11
11
12
13
15
15
15
16
18

VI





Web-



3
ACT

ACT
Microsoft ACT
ACT


ACT

Cookie


SSL

SOAP ACT

Web-

ACT
ACT


...

19
20
20
21
23
24
26
26
26
27
29
30
31

32
32
33
34
35
36
36
38
38
39
39
42

42
43
44
45
45
49
66
.. 69

4








, ,


,

System

ACT Team


ACT Team










Microsoft Network Monitor

VII

70
71
72
77
78
84
85
86
89
90
92
93
96
96
98
100
107

108
108
109
111
112
112
113
116
116
118
119
120
127

VIM

Application Expert Compuware


Application Expert

1 30
136
141

6
WEB-

142

ASP.NET
ASP.NET

Web-
Web- .
IIS




ASP.NET

ADO.NET
Web-
Web-
,
?
Web-
Web-

181
182
183
1 84

185

CLR
Microsoft Intermediate Language


Web- .NET

-

143
144
144
146
148
149
149
157
162
165
165
167
1 70
171
177
181

185
186
186
188
188
1 88
189
190
1 94


.NET
.NET CLR Memory
.NET CLR Loading
.NET CLR Locks And Threads
.NET CLR Exceptions
.NET CLR Security

Compuware DevPartner Studio
AppMetrics
.NET Enterprise Services
AppMetrics

IX
196
197
200
201
202
203
205
205
211
213
215
218

8 SQL-

219

220
221
229
237
237
245
246
262

9
MS-
:





1:
2:

3:

4:
5:
...

263
265
265
266
267
269
270
273
276
281
285
287

10 :

288







Indy:

Indy
Indy
IndyView

, Indy

314
314
316

318

325

289
290
291
291
293
297
298
298
299
301

Microsoft Application and Consulting Engineering (ACE) Team


,
. -, (Mike Adams)
(Tracy Shell), , . , . IMatt
Odhner) no ACT ,
, (Jini Pierson) - 5, (Fabio Yeon) (Mitica Manu)
6, (Eric Rachner), (Chad
Dellinger) (Mitica Manu)
. (Julius Chen) (Ken Henderson),
no TCA
(Transaction Cost Analysis ) (David Guimbellot). , 9 (Perry Clarke),
no TCA, (Chris Lawson) - , . MSN
Enterprise Tools (Jonathan Hardwick) (Stathis Papaefstathiou), .
, (Robert Dillingham)
Team. , (Juliana
Aldous) (Lynn Finnel} Microsoft Press , , . ,
, (Mahesh Prakriya)
.NET Framework,
.


, Microsoft Application Consulting and Engineering (ACE)
Team, Web-
Microsoft. ,
, , Web . , , Web- Microsoft.

. , - Microsoft.


Web
( , , ), ,
, . ,
, Web-,
Microsoft.
. , Web-, , ,
.

XIII


-
- :

-;

;
ASP;
;
;
Compuware Application Expert ( Microsoft PowerPoint);
,

-
StartCD -.
,
, -. , 5tartCD.exe - Start. , , ,
, Web- Microsoft Press,

ACT, ,
Sample Files -.
, Setup.exe Setup
. 5 . , , .
ASP
Microsoft Word, ASP Microsoft Visual Basic Scripting Edition (VBScript)
(Script, ChapterOS -.

XIV


, - (
Chapter04). IIS (Internet Information Services) SQL Server.
PowerPoint: Compuware Application Expert
Compuware Application Expert .
PowerPoint ChapterOS - Application Expert.

- , . Autorun. eBook. Microsoft
Internet Explorer 5.01 ( ), HTML Help. Internet Explorer 5.01 ( ) , Internet Explorer 5.5
, .
.
Microsoft Windows NT 4.0, Microsoft Windows 2000
Microsoft Windows XP.
. ,
Internet Explorer 5.01 (
),
perftest.CHM \eBook\ls_001.


Microsoft Windows XP Windows 2000.
Microsoft Visual Studio .NET, Enterprise Developer Enterprise
Architect.
Visual Studio .NET:
/ Pentium II,
450 ;
96 Windows 2000 Professional; 160
Windows XP Professional;

XV

2.5 , 500 ;

CD-ROM DVD-ROM;

Super VGA (800 600) , 256 ;


Windows 2000 Windows XP;

Microsoft Mouse .


, (. 1-1.).
. 1-1,

1,2
3,4

5,6, 7,8
9, 10

. ,
,
.
1:
1 , ,
. ,

. ,
.
2:

XVI

. 2 ,
, ,
,
IIS, .
3: ACT

Web-, Microsoft,
Microsoft
Application Center Test (ACT). ACT . 3 , ACT , Web-,
4:

System Monitor ( )
Web-. 4 System Monitor , , , .
5:

5 .
, , Network Monitor
, (round trip).
6: Web-

, IIS,
ASP.NET,
SQL. , 11$

XVII

. ,
IIS.
7:
Web- Microsoft .NET , 7
.NET Framework,
Web-
.NET. .NET
.
8: SQL-
SQL- Web . ,
.
Microsoft SQL Server
SQL. 8 ,
SQL Server,
SQL Server ,
9; US-
9 Microsoft
() Web-.
Web-
;
, .
: :

. ,
,

. 10 ,

XVIII

,
, .
(toolkit) Microsoft Indy.

, -.
, Microsoft Press
:
http://www.microsoft.com/mspress/support/
Microsoft Press Knowledge Base
:
http://www.rnicrosoft.com/mspress/support/search.asp
, -,
Microsoft Press :
:
Microsoft Press
Attn: Performance Testing Microsoft .NET Web Applications Editor
One Microsoft Way
Redmond, WA 98052-6399
:
MSPINPUT@MICROSOFT.COM
, ,
. Web- Microsoft Product Support:
http://support.microsoft.com

, .NET Microsoft , , Web- , .


,
, PDA (Personal Digital
Assistant) WAP (Wireless Application
Protocol). ,
. Web-
, , .
, .



, ,
, . ,
- , . , -


, ,
.
, .



11 2001 Web- Microsoft. ,
. ,
Web-
- . , ,
, , , Web- , .
,
11 2001 .
, ; Web-hpu- .
, ? , I; . ,
;; , .
Web- ,
1 I . Web- ;
, Web-

, .

,
, = ,


, Microsoft
.NET Framework, Windows DMA (Windows
Distributed interNet applications Architecture).
.NET no- Web- ASP, , Web .NET, Web- Windows DNA.
, Windows DNA
.
, , , .
,

.



- Microsoft
, , '= sapoe.
, - .;
. 8

, *. .'
( ) - ;|
. . .

, .

Microsoft - ! - :
. , ' 5
10 8 ,
10 ,
.
70%,
. - ...
11 ,
,
\: ,
:
. ,. , , , ,; ' .
, Web-
. Web-. , , .

.NET
.NET, .NET Framework,
, .NET. ,
, ,
, .
Microsoft .NET. .NET http://
www.rnicrosoft.com/net.

.NET
.NET? no-: .NET? .NET
, , Web- XML,
, Web-,
.
.NET,

.NET Framework ,
Web- XML .
:
(common language runtime, CLR) , ASP.NET, Enterprise Services, ADO.NET Windows Forms.

Visual Studio .NET


Microsoft .NET.
Mobile Internet Toolkit
PDA , .
.NET Enterprise Application Center 2000,
BizTalk Server 2000, Commerce Server 2000, Exchange Server
2000, Internet Security and Acceleration Server, Host Integration
Server 2000, Mobile Information Server 2001 SQL Server 2000.

.NET- Web- XML, Microsoft; Web- XML


.

. 1 -1 , .NET
, .
.NET Framework
Web-. CLR ,
. Web-
,
. Web-, .NET
Framework, .NET Enterprise
, .

.NET Framework

C#

Python

Web-
Win Forms
ASP.NET
(ADO.NET,


.NET Enterpise

Windows 2000 (Server, Advanced Server, Datacenter Server)


,

. 1-1. .NET
.Net
, ,
, , .
,
. ,
PDA. ,


, -!
Web- XML - = :
;
Mobile Internet Toolkit,
, PDA -..
. 8 .NET ,
- '!
\*,- (. . ..
.; ), Web- - : ;

. Web- , , .

.NET
, .NET -, .NET Framework ,
Web. , .NET Web-, :
XML (Extensible Markup Language );
SOAP (Simple Object Access Protocol );
HTTP (Hypertext Transfer Protocol ).
XML ,
HTML; HTML , (), (). XML .NET -
HTML . HTML, -
no-. ,
Web-
HTML-. -

HTML
. , HTML
. HTML . XML ,
, HTML.
.NET XML-,
SDL (Service Description Language), WSDL (Web Services Description Language Web). , WSDL Web-.
.wsdl, ,
Web-. SOAP
.
RFC (Remote
Procedure Call ), SOAP XML . XML
SOAP , ,
.

UDDI
.NET UDDI (llniversal Description, Discovery u Integration , ),
Web-. Web-, ,
. INIM (Internet Native Integration Methodology
) XML-
. INIM
, Web-, .

UDD!
Web-.

Web- XML
- , , ,
, - , . ,

. Web- ,
. Web-
Microsoft .NET Passport,
. Web- Web-
(. . HTTP, XML SOAP) Web-. Web-, Microsoft .NET,
Web. Web- XML Web-, , , ,
Web-. XML.
XML
SOAP,
(,
, Macintosh, Unix
Linux, Windows ).
Web- - ,
, Web. Web- , .NET . XML ,
Microsoft, . .NET Framework
.NET Microsoft Visual Basic .NET,
Microsoft Visual C++ Microsoft Visual C#.

10

Microsoft .NET Passport


.NET Web-cep, , .
, , Microsoft *NT Passport . Web- ,, 160 , 10 .
.NET Passport 1,5 , Web-
, Web- XML.

Web-

, Web, , .NET.
. , , . ,
, . , ,
,
. , XML- .NET,
.



, - . , . ^ . Web-, ,
Web-.
:
Web- -::
:= , :
' . .NET,

11

=;
XML-. ,
-.
. .

Web-
Web-
.
,
.NET-. .NET

, .
.


Web- .NET,
, ,
. ,
, . , , .
(availability) . -

12

, . , , .

.



, ,
. Response Time In Man-Computer
Conversational Transactions, (R.B. Miller)
1968 AFIPS (AFIPS Fall Joint
Computer Conference, Vol. 33, 267-277),
:
0,1 , , ,
;
1,0 , , ; , 0,1 1
,
;
10 , ; ,
,
, , ,
. , ,
, .
,
, -

13

0,1 . ,

, .
- ,
.
,
(( (bottleneck), .
,
.NET- .



Web-,
, .
, :

, .


.
, 8 Web- ,
Microsof, (Transaction Cost Analysis
). Web- , , , .
, .
, , :

.
. , ,
, ,
. 1-2.

2.


Microsoft
Performance Monitor
1





3.



ASP.NET

SQL
( ]

. 1-2.

15


, .
: 1) ,
, G , 2) ,
. , 115,
, . ,
, .
, .
2.


,
.
,
, . Microsoft Application Center Test (ACT)
3.


, ,
. , ,
,
. ,
, ,
, , (smoke test).

16

,
, 3.


, . , , , .
, . , .
. 6 Web-. 7 . , 8 SQL-.
, SQL- , . SQL- ,
, Web-.
, ,
. -

,

, ,
; , . (
) , , .
, ,
, . -

17

,
,
.
, ,
,
,
, .
,
.


, ? , . ?
, ,
. , , ,

.
, (
) ( , ). .NET , .
,

. -

18


,
.


. , . ( )
. , , ; ! ,
?
, ? , ,

, .NET , 2, . , ,
.

Web-
. Web-, , . ,
Web- ,
.
,
, .
,
.
, , ,
, .

, ,
Web-
, -

20

.
Web- . ,
, .

, Web
.

. , , -,
.
,
, , Web- - . , .

:
;
;
.


,
Web-, ,
. 2-1, .
.
,
Web-,

21

.
. , 70- , , DSL
256 /, (28,8 /).
15 ,
DSL , 5 .

, 5.
, ,
, . ,
, . . 2-1
, .
. 2-1.

(28,!1 /) DSL (256 /)


1 00
1 000

1 (1,5 /)
50




, :
;


Web- ?

22

, Web-, System Monitor


, .
Web-
. , ,
. ,
Web- ,
, ,
. . 2-2
Web- IBuySpy.
,
Web-.
.
, ( ), ,
.
. 2-2.

, %



Bxoq

14


1 400
6 200
1 000
i

7
100

10 000

23


,
.

.
,
,
, (). 1 Web : , ,
, , .
, ,
,
, . ,

, ,
.

, , .,

(, }.
Web-
.
SQL-, .
,
Web-. , -

24

,
.

Web-, . , 10% . . 2-3 ,
. ,
Web- 10 000 10% .
,
.
. 2-3.

10 000

13 310

16 104

21 434

12

28 529


IIS. , ;
.

. , . IIS ,
Web- , .
,
, ,
, . . 2-4

25

.

. ,
Web-.
. 2-4.
/

, %


default.aspx

search. aspx

productfeatures.aspx
productoverview.aspx

basket, aspx

checkout, aspx
checkoutsubmit.aspx
confirmation. aspx

720 000

40

720 000

90 000
90 000

450 000
216 000
234 000

25

.
12
13

360 000

'(]

360 000
180 000
90 000

1C

54 000
36 000

1 800 000

!0

.
2
100

. (hit) Web-,
HTML, ASP ASP.NET, . ,
, . , , HTML.


. ,
,

26

Web- , .


fbackend activity profile)
Web . , .


Web-

, Web-.
- , , , . . .
, , -,
,
, ,
.
. 50% , .


Web ,
, ,
(deadlock) .
SQL
SQL Profiler Performance Monitor, cogep-

27

Web-
Windows SQL Server. , SQL , . .
8.
, ,
.


,
Web,
. ,
, . , , .

Web-
no-. , ,
-
.
.

, , , ,
,
, , . ,
- ,

28

, - .
, ,
.
. ,
, .
Web- . Web-,
, , . , Web-
, 75- .
2 000 ,
. ,
Web-, , .
Web-.

. ,

,

. . , Web- , , , , .

Web-,
-. -

29

. , , ,
, ,
. . 2-5. 500
,
Web- ( Web-). . 2-5
.
; , .
. 2-5.



( )
ASP

Web-

Performance Monitor
Performance Monitor
Performance Monitor
Performance Monitor
SQL Profiler
IIS

< 75%

> 1 28
2

<1
< 500
<1

.
, , Web-, .
.

.
, , -

30


, .
, , , .

,
, , Web-, , , , .
.
Web-.

.
, ,
. , , Web- , .
Web-.
,
.
, , ,

. , .

31

* . ,

Web-.
,
.


Web-, . , , , .


Web- . .
Web- , , , . (stress testing)
. (throughput) , .
, Web-. ,
.

Web-, ,
. ,
, ,
.

ACT

33

, ,
.
, , . () , .
, .

,
. , Web-.

.
, , . , Microsoft
Application Center Test (ACT). , , ,
no ACT,
, . ,
ACT Web- .NET.

ACT
ACT (Microsoft Application Center Test) ,
Web-, , , Web-.
ACT , -

,
.

Microsoft ACT
ACT Visual Studio .NET Enterprise
Architect. Visual Studio .NET , ,
ACT.
.
. 3-1.
Vbunt Slttrtlii .NfrSeiup

Visual Studio .NET Setup

. 3-1. Install Windows Component Update


Step 1: The Install Windows Component Update
. Installation, . , .


,
, .

ACT

35


Installation Step 2: Install Visual Studio
.NET. Visual Studio .NET. , ACT.
Visual Studio,
. Application Center
Test Select Items to Install Enterprise
Development Tools, . 3-2, .

Microsoft1

Visual audio .NET

9isuaE Studio .net

teM items tn ".1


[g*Jsu,imiidip.Nn EnterarrseDiwIopei
X Language laols
g-HifeeilrrpHie Development Tcnll
X *>* 5b>fc Enterprise fi^plelrs
'

3 D X -i*J* -- .ii*s
S O X Ert3'pfis3-Mn(ilM
0 ? Appfication Center Tf L
X Visual Siijdio Anabser

rilDX^EI(ram'(iSDK
7 D X [>*stal iM Visual Studip .PiEf
7 X TuoKh" Hid.5bbiir] AnpllcatioiB
E X Strvn Components
X SIJI Server Desktop Frtqun8 X Documentation

. 3-2.
Step 3: Service Releases Check , : .

ACT
ACT
, , .

36


ACT,

HTTP-, Web- . , referrer, user-agent, . Visual Basic Script (VBScript), Jscript, PERL
, .
ACT
VBScript.

ACT
Web-, , ACT, (simultaneous browser connection, SBC). ,
(stress thread) (virtual user},
ACT SBC ( ).
: SBC
? SBC , , Web-. ,
(sleep time) (, ),
,
Web-. ,
, , Web-, SBC Web-.

. ,

ACT

37

. , 5-
, Web-, ,
, .
ACT Sleep Test.
ACT :
fEnableDelays = False
If fEnableDelays = True then Test.Sleep (0)
fEnableDelays
false.
5 , 5 000 , ;
fEnableDelays = True
If fEnableDelays = True then Test.Sleep (5000)

,
:
Function RandomSleepO
Dim IMinSleep, IMaxSleep, ISleep
IMaxSleep = 5000 ' 5 seconds
IMinSleep = 1000 ' 1 second
' .
Call RandomizeO
ISleep = Int((lMaxSleep - IMinSleep + 1) * Rnd(1) + IMinSleep)
Call Test.Sleep(lSleep)
1
.
RandomSleep = ISleep
End Function
,
. . , , ,
.
,
, . .

38

,
SBC .


ACT
. SBC . ,
SBC 25,
25 . Web- , ACT
. Web-
Windows NT LAN
Manager (NTLM), . ACT
( ), . SBC .

Test. Test.CetCurrentUser,
:
Dim oUser, sUserName, sPassword
Set oUser = Test.GetCurrentUser
sUserName = oUser.Name
sPassword = oUser.Password

Cookie
HTTP
cookie ACT. Cookie , a ACT . ,
HTTP- Cookie, ACT , Web-,
.
(Automatic). no ACT -cookie.

ACT

39

, , referrer,user-agent, host, HTTP .


, ;
"Test.SendRequest("http://Localri cist/samples/browse r.asp")"
ACT ,
Mozilia/4.0 (compatible; MSIE 5.01; Windows NT 5.0) user-agent.
, user-agent ( Web-),
HTTP , :
Dim sUserAgent, (), sSeed
sArrayd) = "Mozilla/4.0 (compatible; MSIE 6 . 0 ; Windows NT 5.1)"
sArray(2) = "Mozilla/4.0(compatible;MSIE 4.0;Mac PowerPC)"
sArray(3) = "Mozilla/5.0 {Windows; U; Win98; en-US; m18) Gecko/
20001108 Netscape6/6.0"
RandomizeO
sSeed = Int((3 * find ) + 1)
sUserAgent = sArray(mySeed)


ACT
:
Windows NT LAN Manager (NTLM),
, , -
Microsoft Passport.
. Microsoft Passport , ( ). :

40
. 3-1.

Windows-
Passport

Windows-
ACT Windows; Web-, N5 . Web- no- ,
. ACT.
1. . ACT ,
Web-
.
2. ACT.
, Web.
3. Web-
.
4. ACT, :
oHeaders.Add "Authorization", "Basic XXXXX"
5. ACT .
6. .
-
ACT , , --

ACT

41

. -
ACT :
Basic and Digest Authentication.es
'Basic Authentication Code
oHeaders.Add "Authorization", "Basic xxxxx="
'Digest Authentication Code
oHeaders.Add "Authorization", "Digest username="+chr(34)+_
"domain\username"+chr(34)+", realm="+chr(34)+"IBUYSPY"+_
chr(34)+", qop="+chr(34)4"auth"+chr(34}+", algorithm='4_
chr(34)+"MD5"+chr(34)+", uri="+chr(34)+"/storevbvs/"+_
chr(34)+", nonce="+chr(34)+"xxxxxxxx"+chr(34)+",_
nc=00000001, cnonce="+chr(34)+"xxxxxxx"+chr(34}i-",_
response="+chr(34)-t-"xxxxxx"+cnr(34)


Web-. ACT ,
.
Microsoft Passport
Microsoft .NET Passport Web-, -,
(sign-in) .
,
,
. Web- Passport SSL, ACT
. ACT, , Passport
. , Passport , .
Passport , , . Passport, ACT Development Team,
.

42

SSL
ACT ,
, 40- 128- SSL
Web-, SSL, ACT , ACT ,
. SSL .
80 443 Test.CreateConnection 5SL. Test.CreateConnection,
80 443:

SSL
SSL

oConnect = Test.CreateConnectlon(strServer, _
IPort, bUseSSL)
oConnect = Test.CreateConnection{"YourServerNaine",
60, False)
oConnect = Test.CreateConnection("YourServerNarae",
443, True)

SSL Web- ,
, .

SOAP ACT
SOAP XML . SOAP http://msdn.microeoft.com/vstudio/. ACT SOAP, ,
SOAP- .
SOAP-
set con = Test,CreateConnection(YourServerName, 80, false)
set req = Test.CreateRequest
set headers = req.Headers
req.Path = "/Logon.asmx"
req.Verb = "POST"
req.HTTPVersion = "HTTP/1.
headers.RemoveAll

ACT

43

headers.Add "Host", "(automatic)"


headers.Add "SOAPAction", chr(QUOTE) & _
"http://YourServerName/LogonUser" & chr(QUOTE)
headers.Add "Content-Type", "text/xml; charset=utf-8"
headers.Add "Content-Length", "(automatic)"
body = "<?xml version="& chr(QUOTE) & "1.0" & chr(QUOTE) & "_
encoding="& chr(QUOTE) & "utf-8" & chr(QUOTE) &"?>"
body = body & "<soap:Envelope xmlns:xsi="&chr(QUQTE)&_
"http://www.w3.org/2001/XMLSchenia-instance" &chr(QUOTE)& "_
xmlns:xsd=" &chr(QUOTE)& "http://www.w3.org/2001/_
XMLSchema" &chr(QUOTE)& "_
xmlns:soap=" &chr(QUOTE)& "http://schemas.xmlsoap.org/soap/_
envelope/"4chr(QuOTE)&">"
body = body & "<soap:Header>"
body = body & "<CorrelationHeader xmlns="&chr(QUOTE)&"http://
YourServerName/"_
&chr(QUOTE)&">"
body = body & "<Contents>string</Contents>"
body = body & " </CorrelationHeader>"
body = body & " </soap:Header>"
body ~ body & " <soap:Body>"
body = body & "
<LogonUser xmlns="&chr(QUOTE)&"_
http://YourServerName/"&_
chr{QUOTE)&">"
body = body & "
<licenseeAccotint>Microsoft</licenseeAccount>"
body = body & "
<userName>testact</userNanie>"
body = body & "
<userPassword>testact123</userPassword>"
body = body & "
</LogonUser>"
body = body & " </soap:Body>"
body = body & "</soap:Envelope>"
req.Body = body
set res = con.Send(req)

(viewstate) ,
ASP.NET Web-. ACT
. ,
:
Viewstate. cs
' VIEWSTATE.
If InStr(oResponse.Body, "__VIEWSTATE") Then

44

3
Post = InStr(InStr(oResponse.Body, "__VIEWSTATE"),_
oResponse.Body, "value=")

Pos2 = InStr(Pos1, oResponse.Body, ">")

res = Mid(oResponse.Body, Pos1 + 7, Pos2 - Pos1 - 8)

viewst = res
End If

' VIEWSTATE :
1
"+" "%2".
viewst = Replace(viewst, "+", "2")
1
" = " "".

viewst = fleplacefviewst, "=", "X3D")

VIEWSTATE ( Post)
, : oRequest. EncodeBody = True.

Web-

ACT Robots Exclusion Standard,


() Web-
Web-, . ACT
Web-, robots.txt
:
ft Stress Agent user-agent ACT
.

User-agent: Stress-Agent
# / ACT Web-
Disallow; /

Web-,
robots.txt, ACT , . : Robots.txt denied access to Web serven*.



, Passport. ACT
Properties (
Properties).

ACT

45

ACT
ACT. ,
. ACT SQL- ACT.
, ,
, ,
( SBC).

ACT
ACT .
, . 3-3.

.,...,,- .,;=!. ..-- ,,


- . .i ,( , .' .1 .

application Center Test provides several


mefriods of ** mi* ttfonafA paja
in your Web application Use Die meiriod ttiat
best meets ycur accuracy reeds. Appl'cation
lemer ~est jrfers rt.fferem ie:t lyp<!5,
prQvldmg unique benefiG that might Be more
appropriate fty s'mulalnrj | traffic against
"jr aapl^aton
Configuring Test Properties
Test propabas can be modified to suit you

Application Center Ti?st Nev


How in gel support OrJine

. 3-3t ACT
. , .

46

ACTSamples,
ACT.
.
C:\Documents and Sett ings\< >\ Documents\ACT Projects. .act
, , .

My
Documents ,
ACTUser , ACT .

ACTUser does not have permissions to the folder.
.: Tests, Results
Users, .
Tests

. , . ,
, . Properties.
, . 3-4.
Tests
New Test .

. ACT .
Results


. Results . 3-5.

47

ACT

. 3-4.
fa ACTSamnles

Micriwoll ApBMraifon Cen)e[ Test

r Type [E.mple 3)
(Example 2)
(Eismple 1)

reprf t-TMcFil

Test Maine ;
Test Run Name:
Tert Started:
Test Duration:
Test Iterations:
Test Notes:
View:
Sort By:

iCTSamples: Browser Type


repcrt-Browser Type (Exampls 4;
06/14/2001 6:36:32 PM
30:00:01:00
3,470

Averages
General
Ccr'er: Length:
Ti-rie to First
Byte:
Time to Last
Byte:

Per
Ailili
A

j rr.b si HtJJaqygs t

3th Pe

. 3-5.
. .

48

. ,
Report .
.
ACT Overview,
Graphs Requests. ,
(requests per second, RPS),
(Time To Last .Byte, TTLB), . XML-.
. ACT.
Users

,
. , .
, . Del.
ACT
-.
Import Users Actions.
, ACT,
Web-.
,
.


,
. SBC.
, Web- , ( Users).

ACT

49


ACT ,
-
IBuySpy. IBuySpy ,
.NET.
IBuySpy . http://www.ibuyspystore.com/. http://www.ibuyspy.com/downloads.htm
.
ACT .
, . New Project File. New
Project .
IBuySpy, C:\ProjectV C:\Project\ IBuySpy. , IBuySpy.act
, . ACT
XML, , ,
.

Web-. , Tests
New Test New
Test. Next Record A New Test. Next Start Recording.
, , .
1. \1://< >/.
2. boat Search,
Web-.

50

3. Go .
,
Stop Recording. , ,
, . Next . Next Finish.
.
, IBuySpy.
Search, vbs
Option Explicit
Dim fEnableDelays
fEnableDelays = False
Sub SendRequest1()
Dim oConnection, oRequest, oResponse, oHeaders, strStatusCode
If fEnableDelays = True then Test.Sleep (0)
Set oConnection = Test.CreateConnection("YourServerName",
80, false)
If (oConnectton is Nothing) Then
Test.Trace "Error: Unable to create connection to
YourServerName"
Else
Set oRequest = Test.CreateRequest
oRequest.Path = "/StoreVBVS/default.aspx"
oRequest.Verb = "GET"
oRequest.HTTPVersion = "HTTP/1.0"
set oHeaders = oRequest.Headers
oHeaders.RemoveAll
oHeaders.Add "Accept", "image/gif,
image/x-xbitmap, image/jpeg,_
image/pjpeg, application/vnd.ms-excel, _
application/vnd.ms-powerpoint,
application/msword, */*"
oHeaders.Add "Accept-Language", "en-us"
oHeaders.Add "User-Agent",
"Hozilla/4.0 (compatible; MSIE 6.0;_
Windows NT 5.1)"
'oHeaders.Add "Host", "YourServerNane"
oHeaders.Add "Host", "(automatic)"
oHeaders.Add "Cookie", "(automatic)"
Set oHesponse = oConnection.Send(oRequest)

ACT

51

If (oResponse is Nothing) Then


Test.Trace "Error: Failed to receive response
for URL to " + "/StoreVBVS/default.aspx"
Else
strStatusCode = oResponse.ResultCode
End If
oConnection.Close
End If
End Sub
Sub SendRequest2()
Dim oConnection, oRequest, oResponse, oHeaders,
strStatusCode
If fEnableDelays = True then Test.Sleep (130)
Set oConnection = Test. CreateConnection("YourServerName",
80, false)
If (oConnection is Nothing) Then
Test.Trace "Error: Unable to create connection
to YourServerName"
Else
Set oRequest = Test.CreateRequest
oRequest,Path = "/StoreVBVS/IBuySpy.ess"
oRequest,Verb = "GET"
oRequest.HTTPVersion = "HTTP/1.0"
set oHeaders = oRequest.Headers
oHeaders.RemoveAll
oHeaders.Add "Accept", "*/*"
oHeaders.Add "Referer",
"http://YourServerNarne/StoreVBV$/default.aspx"
oHeaders.Add "Accept-Language", "en-us"
oHeaders.Add "User-Agent",
"Mozilla/4.0 (compatible; MSIE 6.0;Windows NT 5.1)'
1
oHeaders.Add "Host", "YourServerName"
oHeaders.Add "Host", "(automatic)"
oHeaders.Add "Cookie", "(automatic)"
Set oResponse = oConnection.Send(oRequest)
If (oResponse is Nothing) Then
Test.Trace "Error: Failed to receive response for
URL to " + "/StoreVBVS/IBuySpy.css"
Else
strStatusCode = oResponse.ResultCode
End If
oConnection.Close
End If
End Sub

52

Sub SendRequest3()
Dim oConnection, oRequest, ofiesponse, oHeaders,
strStatusCode
If fEnableDelays = True then Test.Sleep (20)
Set oConnection = Test.CreateConnectionC'YourServerName",
80, false)
If (oConnection is Nothing) Then
Test.Trace "Error: Unable to create connection _
to YourServerName"
Else
Set oRequest = Test.CreateRequest
oRequest.Path = "/StoreVBVS/images/sitebkgrdnogray.gif"
oRequest.Verb = "GET"
oRequest.HTTPVersion = "HTTP/1.0"
set oHeaders = oRequest.Headers
oHeaders. RemoveAll
oHeaders.Add "Accept", "*/*"
oHeaders.Add "Referer",
"Http://YourServerName/StoreVBVS/default.aspx"
oHeaders.Add "Accept-Language", "en-us"
oHeaders.Add "User-Agent",
"Mo2illa/4.0 (compatible; MSIE 6.0;^
Windows NT 5.1)"
'oHeaders.Add "Host", "YourServerName"
oHeaders.Add "Host", "(automatic)"
oHeaders.Add "Cookie", "(automatic)"
Set oResponse = oConnection.Send(oRequest)
If (oResponse is Nothing) Then
Test,Trace "Error: Failed to receive response for
URL to " + "/StoreVBVS/images/sitebkgrdnogray.gif"
Else
strStatusCode = oResponse,ResultCode
End If
oConnection.Close
End If
End Sub

Sub SendRequest17()
Din oConnection, oRequest, oResponse, oHeaders,
strStatusCode
If fEnableDelays = True then Test.Sleep (6910)
Set oConnection = Test.CreateConnection("YourServerName",
80, false)
If (oConnection is Nothing) Then

ACT

Else

53

Test.Trace "Error: Unable to create connection


to YourServerName"

Set oRequest = Test.CreateRequest


oRequest.Path = "/StoreVBVS/SearchResults.aspx"
oRequest.Verb = "POST"
oRequest.KTTPVersion = "HTTP/1.0"
oRequest.EncodeBody = False
set oHeaders * oRequest.Headers
oHeaders.RemoveAll
oHeaders.Add "Accept", "image/gif, image/x-xbitmap,
image/jpeg, image/pi peg, application/vnd.ms-excel,_
application/vnd.ras-powerpoint,
application/msword, */*"
oHeaders.Add "Referer",
"http://YourServerName/StoreVBVS/default.aspx"
oHeaders.Add "Accept-Language", "en-us"
oHeaders.Add "Content-Type",
"application/x-www-form-urlencoded"
oHeaders.Add "User-Agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
'oHeaders.Add "Host", "YourServerName"
oHeaders.Add "Host", "(automatic)"
oHeaders.Add "Pragma", "no-cache"
oHeaders.Add "Cookie", "(automatic)"
oHeaders.Add "Content-Length", "(automatic)"
oRequest.Body = "txtSearch=boat&image1.x=13&image1.y=11"
Set oResponse = oConnection.Send(oRequest)
If (oResponse is Nothing) Then
Test.Trace "Error: Failed to receive response for
URL to " + "/StoreVBVS/SearchResults.aspx"
Else
strStatusCode = oResponse.ResultCode
End If
oConnection.Close
End If
End Sub
Sub Main()
call SendRequest1()
call SendRequest2()
call SendRequestSO
call SendRequest17()
End Sub
Main

54


,
SendRequest#0, # . Mainf). , .
, MainQ. Mainf) ,
.
.
ACT,
Web- .
. Test,
Test, Headers Request. ACT Application Model, .
no ACT.
,
HTTP- (SendRequestT) POST (SendRequestlT), , . , ACT
cookie ,
,
:
oHeaders,Add "Cookie", "(automatic)"
, HTTP- POST, ACT
,
:
oHeaders.Add "Content-Length", "(automatic)"

ACTSamptes, Visual Studio .Net, , .

ACT

55


2 New Test , :
Test.SendRequest("http://localhost")
IBuySpy,
:
Test.SendRequest("http://YourServerName/StoreVBVS")
IBuySpy
.
URL ,
, ,
.
. .
Browse.vbs
Option Explicit
7////////////////////////////////////////////////////////
' : ,
' :
ACT,

.

7////////////////////////////////////////////////////////
Dim i, sParams, sServerName, oUser

7////////////////////////////////////////////////////////
1

: - Security IIS
- ,
- ,
- (domain\username" .
sServerName = "YourServerName"
' , ACT,
Set oUser = Test.GetCurrentUser
oUser.Name = sServerName & "\USERNAME"

56

oUser.Password = "UserPasswordl"
7////////////////////////////////////////////////////////
' .
RandomizeO
' 0 6.
1 = Cint(7 * Rnd(
' .
Test.Trace "i = " & cstr(i)
Select Case i
Case 0
sParams = "CategoryID=144selection=0"

Case 1

sParams = "CategoryID=154selection=1"

Case 2
sParams = "CategoryID=2D4selection=2"
Case 3
sParams = "CategoryID=18&selection=3"
Case 4
sParams = "CategoryID=174selection=4"
Case 5
sParams = "CategoryID=194selection=5"
Case 6
sParams = "CategoryID=164selection=6"
End Select
' .
Test.SendRequest("nttp://" 4 sServerName
4 "/storevbvs/Default.aspx")
' .
Test.SendRequestfhttp://" & sServerName &
YStoreVBVS/productslist.aspx?" & sParams)
' .
Test.SendRequest("http;//" 4 sServerName 4
"/storevbvs/Default.aspx?test=count")

ACT

57

, Web- .
-, ACT,
. ,
Web.

, IIS { W3SVC). test=count, Web-. ,



() .
: Web-, , Web-.
SQL-
ACT SQL- ADO (ActiveX
Data Objects). , ACT ,
.
,
Web .

,
SQL Server ( ,
) SQL,
, ,
, .
, SQL
Server -

58

SQL-. ,
G IBuySpy :
ProductSearcfi Search = N'search string'

SQL Server Scripting Library ADO
IBuySpy . , .
Search_SQL.vbs

Option Explicit
' : SQL- ADO.
1
:
AST
SQL- ADO.

.

7////////////////////////////////////////////////////////
Dim oFso, oCsvFile, oSQLConn, sConnStr, sSearchStr, sServerName
Dim sUserName, sPassword, sPath

7////////////////////////////////////////////////////////
' : - sServerName.
- SQL Server
dbo Store.
- search.txt.
sServerName = "juaceevalS"
sUserName = "USERNAME"
sPassword = "UserPasswordl"
sPath = "D:\Chapter_3\ACT_Project\search.txt"
7////////////////////////////////////////////////////////
'Create an ADO Connection object
Set oSQLConn = CreateObject("ADODB. Connection")
sConnStr = "driver={SQL Server} ; Server=" & sServerName & "_
; Database=Store; uid=" & sUserName & ";pwd=" & sPassword
oSQLConn. Open sConnStr
7////////////////////////////////////////////////////////
' .

ACT

59

Set oFso = CreateObject("Scripting. FileSystemObject")


Set oCsvFile = oFso.OpenTextFilefsPath ,1)
7////////////////////////////////////////////////////////
' .
Do While oCsvFile. AtEndOf Stream <> True
' ,
sSearchStr = oCsvFile. ReadLine
' ACT.
Test. Trace sSearchStr

' ProductSearch.
T

oSQLConn. execute "exec ProductSearch Search = N" &_


trim(sSearchStr) & .....

Loop
' .
uCsvFile.Close
Set oCsvFile = Nothing
Set oFso = Nothing
' .
oSQLConn.Close
Set oSQLConn
= Nothing


.
. .
Test Load Level ( General).
. , . ,
Web-, 10.
ACT 10 SBC, .

60

Test Duration ( General).


: , . 10, 100, , 100. ,
, . ,

. ACT .
Detailed Reporting ( General).
ACT
.

Generate detailed test results Advanced
Settings. Advanced, General.


, .

Users ( Users). ACT ,


, . , , , .
, . , , GetNextUser

ACT

61

Test. Test ACT.


ACT
. ,
. ,
Generate Users Action.
Generate Users, ,
.
, .
Counters ( Counters). Counters
,
Performance Monitor. , Collection
interval. Add
Browse Performance Counters . Performance Counters Counters.

, Web-, .
, SQL
Server.

. ,
. .
,
. , , .

, , Web-, , POST. -

62


. ,
-.
, . ,
. , . ,
,
.

,
.



,
SQL . .
, ,
CUID, , . ,
.
ACT Response, Web-. Response . .
ACT
ACT ,
. ce.log Program FiIes\Microsoft ACT. Debugging , (

ACT

63

), . Test.
TraceLevel ,
Trace.
-.
, , :
Test,TraceLevel = -1
' tracelevel ;
' -1: ;
' 0; ;
1
V. ;
' 2: ,

Test.Trace.
-

Test. (" level is set to " & CStr(Test.TraceLevel))

, TraceLevel no , ACTTrace.log
, , Test.Trace.


.
, ,
. , ,
. ,
,
. , ,
, ,
IIS.

64

IIS
, ,
, . ,
ACT. IIS .


Microsoft Internet Information Server, ACT Web-cepsepa.

SQL Profiler SQL- .
SQL Profiler 8.

ACT Developer Edition .
.


Web-,
.

, ,
, , . , , , SBC . ,
, .
Web-, ,
.

ACT

65

ACT Visual
Studio .NET .
,
. ,
, , .

ACT 2000. . 2000 ,


XML,
ACT. , CreateConnection .
,
ACT .
, ( )
.
. ,
,
? ,

.

;
Sub main()

WhichScenarioToRun = int(Rnd * 100)


Randomize

66

Select Case WhichScenarioToRun


Case 0 To 75
Call myTestl
Case 76 To 87
Call myTest2
Case 87 To 100
Call myTest3
End Select
End Sub
IBuySpy , , ,
-.


,
G . ,
. , :

Web-;
,
;
(, 75%);

;
-
.

(
}.
, . , -

ACT

67

, .
,
. ,
, ,
. . , . , .

, ,
.
.
. ,
. ,
, . ( ) , , . ,
, ,
-,
.
,

(). ,
, ,
, . , , 5 30 .

68

=
SQL,
=
/

/ 60 .
! .
.
, .


,
. , ,
, ,
, .
,
.
. ,
. , .
-
, , DNS,
. . ,
.

ACT

69

, . ,
, .

ACT , , ,
, .
, ACT, .
,
. ,
ACT.

Microsoft Windows 2000 System Monitor ( ), (snap-in) Microsoft Management Console (MMC). ( Windows NT Performance Monitor
Perfmon.) Web-,
Windows-. : System Monitor ( ) Performance Logs and Alerts
( ) .
,
, . .NET Framework 7, ASP.NET IIS 6,
SQL Server 8. ,
Windows 2000, Windows .NET
Server, .

71


,
,
. , . . , Web-
% Processor Time (% ), Processor (). ,
, .

Windows 2000
Server. ,
SQL Server, ,
SQL Server. SQL Server
.
,
. ,
. ,
.
, , .
:
;
;

Windows 2000
;

72

(alerts), . ,
, 90- , , , ;

, , , -, -, ( ).
.
, API ( http://msdn.microsoft.com/msdn-files). , Microsoft.


( ).




: , . , ,
.
,
. .

,
% Processor Time (% ).
, -

7:s

, .
. . 4-1.

. 4-1.

1 . Start (), Programs (), Administrative Tools () Performance ( ).
2. System Monitor ( ) .

. , , . .
. 4-2.


perfmon Start ()/ ().

74

. 4-2.
3. ,
View Chart ( )
.

, , , , . , gpv .
, . [ Property Name ( )
System Monitor Properties (: )],
,
Display ()
. :

BackColorCtl , ;

BackColor ;

ForeColor .

. , , ,

75

, .
0,0000001 1000000,

, . ,
, ,
, .
Instances ().
, 0. ,
0 3.
.
, transaction/sec (/)
,
, , .
, % Processor Time
(% )
.
.

Microsoft Windows Explorer Windows
Explorer Thread (), Windows Explorer ( ).

, , 1 , #. , . 0 ,
1. , .

76

, , .
Computer Name ( )
, .
,
.

.
,
Properties (),
System Monitor Properties (;
) General ()
Value Bar ( ).
:
Last () ;
Average () ;
Minimum () ;
Maximum ()
;

Duration ()
, .
, . .


. , % Disk Read Time (% )
, , . -

77


Ctrl+B. , Histogram
() Genera! ()
System Monitor Properties (: ).

. 4-3.

, -: .
,
, Web-, , .

.
Report () Ctrl + R. Report ()
General () System Monitor
Properties (: ).


,
, .

78


.
. , , , , , . ,
, .
, 15 .

. 15
, .

300 (5 ).
, ,
.

,
.
, .

, no-
, .
.



.

, . ,
, 50- .
Web- . : ,

79

. , Web-
.

. , ,
s ,
. , ,
, 20 22 . ,
.



, .

.
,
, .
Windows 2000
.
1. Start (), Programs (),
Administrative Tools ()
Performance ( ).
2. Performance Logs And Alerts
( ).
3. Counter Logs ( ).
4.
New Log Settings ( ), . 4-4.

tin

j Svs: em Monitor
^^ . This pm.ufcs e
Pformano|LOM ndAlertJ 5

BnaryRle

\PeHtogs\5vsle

fa

Lu.

Jif

. 4-4.
5. New Log Settings ( ), . 4-5, . IBuyspy.
1
||||

i"

''- * ''''

^IB^J :H*

- "uvi rv ;-

. 4-5.

6. , , Performance Log ( ). Add (),


Select Counters ( ).

;;

7. ,
Add (). , Close (). General () Performance Log ( )
.
8. , , , , , Log Files ( ).
CSV, . . 4-6, .


,
. ,
: , CSV.
JC1I*

. 4-6.
9. , Schedule ().
, ,
.

82

10. .
.
, , . 4-7.

. 4-7.
, .

,
Start () Stop.
, .
1. System Monitor ( )
, .
2. View Log File Data
( ), Select Log File ( ),
. 4-8. ,
, , Open
().
3. Add (),
.
Add Counters ( ), , . 4-9.

83

,
.

j?i i S"*^ J

Jp

. 4-8. Log File

. 4-9.

.
1. Properties () .

4
System Monitor Properties (: ) Source ().
Source ()
, , . 4-10.

j Console Root
'I
|g pwfoinbgs<
H Cnur*Logs

. 4-10.
4. ( .) System Monitor
Properties (: ),
5. ,
.


.
, , , .

.
.
1. Administrative Tools ()
Local Security Policy ( ).

85

2. Local Policies ( ),
.
3. User Rights Assignment (
). .
4. Access This Computer from the Network
( ) . ,
.
5. Add User or Group ().
.
1. Ctrl + l, Add Counters ( );
2. Select Counters From Computer (
) .
. (128 /
), ,
, .
.

, ,


, ( ,
,
). , ,
. .

86

. , .
, . Add Counters (
), ,
, Explain ().

Web-
.
,
. Processor (),
, , .
,
75% ,
100%. ( ),
. , , , 90- ,

70-75%.

Add Counters ( ) . Total instance ( ) .
.
, . , Processor ().

% Processor Time (% ) -
, ,

87

.
,
.
( , .)

. , , ,
,
% Privileged Time {% ) , .
Windows
, . , .
, , . , Windows


. , Windows no , , .

% User Time (% )
,
. % Privileged Time (% ) System () Processor (),
.

% Interrupt Time (% ) , .

88

4
, , , , , , .
. .
10 , . .

Interrupts/sec ( )

.
(deferred procedure calls, DPC) . , , ,
, , , .
,
.
10 ,
.

4-1.
. 4-1.

Process\ % Processor Time

Processor('_Total)\
% Processor Time


.
, .
,
50% , !

,

89

,

, , , . , , , .
(90%
), ,
, .
.
, US-,
Web-,
+ , Visual Basic , , + 90% .
-
Web- .
(
) ( ), . ,
+ Web- .

. , Web-.
,
. . , -,
, -, . Web-

90

. , ? ,
. , ,
. Processor () System () , .

System
System ()
, .
.
.

Processor Queue Length ( ) . ( ) , .


,
,
. , , .
, , System\Processor Queue Length- He
(90%
) .
Processor
Queue Length 2 . , ,
,
.
, Processor1^ Interrupt Time (^ ) -

91

, , ;

Context Switches/sec ( /)

. ,
,

Executive . [Thread\Context Switches/sec (\ /)] . V
System () Thread ()
.
, .
, -

, . .
, , , .
,
15 000
. ,
, Processor\%
Privileged Time (\%
). 40% ,
.
, , $ystem\Context

92

4
Switches/sec, ,
Thread\Context Switches/sec _Total.
, .


. ,
, .
, . , ,
, .
,
, . : -, ,
. .

.

, . , , , , , .
.
,
.
, , . .
* Average Disk Queue Length ( )
,
.
Average Disk Read Queue Length (
) , -

93

.
Average Disk Write Queue Length (
) , .
Average Disk sec/Read [ ()]
( ).
Average Disk sec/Transfer [
()] .
Disk Reads/sec ( /)
.
Disk Writes/sec ( /) .

ACT Team

Microsoft
. Web, . Web- ; ,
.
. Visual Basic ,
. ,
Win32~npuoeue.
.
5 ,
( db1 go db5). ADO OSQL SQL, .
-

94

SQL Profiler.
:
;

;
;

;
;

;
.
, . , .
, 20 (15 ).
20 .
10- 60- .
. 10 60 .

,
.
, -
, ,
.
,
10- 60 , 1. , ;

95

- / 1 =
[On. + {4. )] /


, .
. , RAID 5
85 - .
10- 1.
= 85 -
1 = [269,7 + (4x74,6) ] / 5
1 = 113,62

113,62 1 , 85 .
10- 2.
= 85 -
1 = [136,3 + (4x43,0)] / 4
1 = 77,7

77,7
2, 85
, ,
60- 1.
= 85 -
1 = [294,8 + (4x71,8) ] / 5
1 = 116,4

116,4 1 , 85 .

96

60- 2.
= 85 -
1 = [68.9 + (4x24.0) ] / 4
1 = 41.2

41,2 2, 85
, . , 13,62 116,4
, 1 ,
, ,
85 - .



Web- . ,
SQL Server 2000,
.
SQL-,
. , . , RAID ? , .
.
.

Web- ,
, .
, . (,

97

. , ,
.)
Page faults/sec ( /) -
. , ,
, , .
( ) , ( ).
.
, , .

Available Bytes ( )
, . Pages/
sec ( /) , -
, - .

Pages Reads/sec ( /)
.
,
.

,
.
, .
( ),
, . ,
, ry\Page$ Reads/sec Memory\Pages /nput/sec (\ /).

98

Pages writes/sec ( /) ,

. ,
, , , .
, , . , .

Pages/sec ( /) .
, ,
Memory\Pages Input/sec (\ /) Memory\Pages Output/sec (\ /). ,
, , Memory\Page Faults/sec ( /).
( ),
, .

ACT Team
,
, . Web-. COM-f, Web-. ,

.
. , +.
20 .

99

, .

(. 4-2). 12- . , ,
, (. 4-3}.
671 , dIIhost,
640 no- .
, dllhost.
38 59 . 12- 368 671 , , .
dllhost , , , .
,
, . ,
, , .
. 4-2.
~ -MS

~ /
Bcero-IIS

5ystem-%

55%

1 00%

lnetinfo-%

0,5%

1%

Dllhost-%

41%

1 00%

1 64

1 85

Windows 2000 IIS 5.0

: /

0,2

Inetinfo:

14

1 4

Dllhost:

38

56

100

4-3. 12-
Windows 2000 IIS 5.0

~ -US

5ystem-%
lnetinfo-%
Dllhost-%
:
: /
Inetinfo:
Dllhost:

69%

- /
Bcero-IIS

0,6%

100%
1,5%

71%

100%

56

196

51

295

14
368

14.4
671


Memory\Avaliable bytes (\ }/ Process\Private
Bytes (\ ) ess\ Working Set (\ ). Proces$\Private Bytes
Process\ Working Set, Memory\Avaifable bytes . :
PID .

, .


Performance Logs and Alerts ( ) , .
,
Web- 20 , :
;

;
;

.

. ,
. , 24 , , -

101

Web-. ,
, Pages/Sec ( /). , .
, .
.
1. , Start (),
Programs (), Administrative Tools
() Performance (
).
2. Performance Logs and Alerts (
), Alerts (). , . , ,
,
3.
New Alert Settings ( ).
4. Name () , .
5. , , General
(). , ,
Action (),

Schedule ().


:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Services\SysmonLog\Log Queries

.

102

Security
Regedt32.exe. ,
Performance Logs and Alerts ( ) .
,

.
. ,
,
.
,
.
1.

2. Performance Logs and Alerts (


), Alerts ().
3. .
4. Comment () .
5. Add ().
, , .
1. ,
Performance togs and Alerts (
), Use Local Computer
Counters ( ).

, , Select Counters From Computer ( ) .
2. .

103

3. .
4.
All Instances ( ) (
,
, ).
Select Instances From
List ( )
.
5. Add ().
6. Alert When The Value Is ( ) Under () Over (), Limit () .
7. Sample Data Every ( )
.
3. Action
() Schedule ().

Use Local
Computer Counters ( ).

, .
, .
1. .
2. Performance Logs and Alerts (
), Alerts ().
3. .
4. Action ().
5. , Event
Viewer ( ), Log An Entry in the
Application Event Log ( ).

104

6. Messenger
Send a Network Message to { ) ,
.
7.
Start Performance Data Log ( ) .
8.
Run This Program ( )
Browse ()
.
.
. Command Line Arguments ( !

.
,
,
.
1. .
2. Performance Logs and Alerts (
), Counter Logs
( ), Trace Logs ( )
Alerts ().
3.
, Start ()

Stop () .


,
,
(
).
.

105

1. .
2. Performance Logs and Alerts (
), Counter Logs
( ), Trace Logs ( )
Alerts ().
3.
.
4. Counters () , , Remove ().
.
1. .
2. Performance Logs and Alerts (
).
3. Counter Logs ( ), Trace Logs ( ) Alerts ()
4.
.
5. .

, .
1. .
2. Performance Logs and Alerts (
}, Counter Logs
( ), Trace Logs ( )
Alerts ().
3.
.
4. Schedule ().
5. Start log ( ) ;

Manually (). ,
-

106

4
Start
();

At () .

6. Stop Log ( ) :

Manually (). ,

Stop ();
After () , (,
..);
At () ( , .;
, :
When the Log File is Full
[ ). ,
Log Files ( 2 );
When the n-MB Log
File is Full ( ). ,
Log Files ( ).
7. ( ; ,
):
When a Log File Closes
( ) :

107

(, ) Start
a New Log File ( );
(,
) Run This Command ( ). Browse () ;
When An Alert Scan Finishes ( ) Start a New Alert Scan ( ),
.
, .
1. .
2. Performance Logs and Alerts (
).
3. Counter Logs ( ), Trace Logs ( ) Alerts ().
4.
Delete.
,
(
) .


. ,
.
.

Web-
(Microsoft Windows
NT, Windows 2000 Windows XP), ( HTML, ASP, Windows DMA, .NET)
(RDO, ADO ADO.NET).
, , -, TCP/IP.
.NET , ,
,
,NIET Framework.



no-
, ,
.
, . ,
, OSI (Open Systems
Interconnection),

109

. , . ,
Mitch Tullock Microsoft Encyclopedia of
Networking, Second Edition (Microsoft Press, 2002). , . , , :
(network latency)?,
(round trip)
?, (page view) (content),
Web-?,
. ?,
(processing delay) IIS- SQL-?
,
,
. : Microsoft Network Monitor Compuware Application Expert.



.
, Default.aspx,

, (style sheet), Java . .

, .
Web-, .

110

(bandwidth) , . Web-,
pathping , Visual Trace
Route, Application Expert. Compuware Application Expert Microsoft Power Point -.

pathping ,
ping tracert. ,
pathping
_. , .
. , , , , , . ,
, 56- , 200 , , , 500 . . 5-1 , Network Monitor,
46- IBuySpy Microsoft Internet Explorer. Response Time Predictor Application Expert,

200- 500- 56 /. Application Expert
Application Expert Compuware.
300-
300-, 2,5 . ,
.

111

. 5-1.

, '.

1 0 /

10

0,5

56 /

200

56 /

500

8,5

Web- .
Web-, .

. ,
Web- Web-, ,
.
URL, http://www.rnicrosoft.com, , , , . Web-. , , Application Expert,
, ASP-. . ,
US- . , ASPX IBuySpy 4 ,
6,5 .
,
500 , 200 .
, 2 .

112

. ,


. . 5-2
-, , , . , .
15 ,
.
, .
. 5-2.

1 ()

2 ()

15

19

,
10- 56 /.

, .
, ,
, .


, Web- Web-, ,
. , -

113

IBuySpy 46 24 (
, ). ,
, ,
, 50 . -,
56- . ,
.
. 5-3 ,
,
. 5-3.

8
1

1
1024

1024


, Internet Explorer IIS, IIS, ,
.
HTTP IIS Internet Explorer.
, , -, HTML-, 55-5- . ,
.

IIS. HTTP , Services WWW Service Master Properties, . 5-1.

114

. 5-1. IIS
HTTP, ,
, .
, TXT, )5, CSS, DOC XLS files;
1. HTTP, . 5-1;
2. adminscripts;
3. : cscript.exe adsutil.vbs set WSSvc/Filters/
Compression/GZIP/HcFileExtensions "txt" "js" "ess" "doc" "xls";
4. : cscript.exe adsutil.vbs set W3Svc/Filters/
Compression/DEFLATE/HcFileExtensions "txt" "js" "ess" "doc" "xls";
5. : iisreset.exe /restart.
,
, . ,
, .
.

115

.

, .

, ,
.
, .
Web- ,
. , GIF (Graphics
Interchange Format). ,
. .
, ,
. , Internet Explorer
. Internet Explorer
. JavaScript.

.
, Internet Explorer .


. , Internet Explorer .

116


,
. ,
, SQL- ,
SQL-.
.
1 .
,
. ,
, ,
. ,
, ,
. ,
,
, .
-
.


.
ASPX-, SQL-.
, MS,
SQL. , Network Monitor
Application Expert ,
,
, . :

117

.NET
ASPX-. ASPX- . ="", . 5-2;

<iS Register TsefEefis'-ISuySpi" 7*-1" 9-"_**.

. 5-2. ASPX-
ASP-
.
ASP-
. . - VBScript
JScript ACETimerVB.doc ACETimerJS.doc.
SQL-,
;

118

: response.end ASP, .
ASP- .
,
response.end ASP . ,
, .

SQL SQL Profiler. SQL
Profiler . , SQL ,
Duration .

, . SQL- 8.



. , ,
. ,
, , ,
, ,
IIS,
SQL-. , Application Expert.
,
, , .

121

,
, Web-.
Network Monitor Windows 2000:

Network Monitor 2 Lite Windows 2000


Advanced Server u Data Center. , , ;

Network Monitor 2 Full Microsoft System


Management Server (SMS) 2.
,
Network Monitor.

Network Monitor , . , ,
, , .
- IP-
IP- .
ipconfig/all.

IP-, DNS-, DNS,
- .
, hosts ,
IP-. hosts, , C:\windows\system32\drivers\etc.
Microsoft Notepad
.


, ; ,
.

122

Network Monitor
, Network Monitor .
, ,
:
(capture filter), (capture buffer)
.
, .
,
. . 5-3.
Capture Filter

/ = Any3APoiAnjjETYPE
[Address Pairs)
T-INCLUDE Web Servel IIP] <--> SQL Server JPJ

5-3, Network Monitor


.
1 . , .

10 . . 5-4
Capture Buffer Settings Network Monitor.

123

rapture Buffer Scl lings

. 5-4. Capture Buffer Settings


Network Monitor
, .
,
, .
, ,
Network Monitor ping IP URL Web-. Network Monitor ,
ping . , Network
Monitor
, .
. 5-5 Network Monitor.

Jj

. 5-5. Select A Network


Network Monitor

, , (US-, SQL Server, ),
(, , , , . ).
(availability)
-

124

Web- . ,
Web- . ,
Web-. Network Monitor.
:
,
(switch),
, .
, Network Monitor
.
(spanning)

.

SQL-
:
Web-
Netmon

. 5-6.

125

.
Network Monitor SMS Network
Monitor ,
(. 5-6.);

, : (hub). ; , Network Monitor
(. 5-7};

SQ L-
:
Web-
Netmon

. 5-7,

Network Monitor
Remote Network Monitor .
, Remote Network Monitor . Start () Control Panel ( ), Add/
Remove Programs ( ). Add/Remove Programs ( ) Windows Components ( Windows), Management and Monitor

126

Tools ( ), Network
Monitor Tools ( ) .
, . , ,
. ,
. . 5-8;

:
Web-
Netmon

SQL-:
Netmon

. 5-8. Network Monitor

Network Monitor 2 Lite IIS. Internet Explorer SQL. , Network Monitor US-,
(. 5-9).

127

SQL-
:
XVeb-

. 5-9. IIS Network Monitor


, Network Monitor u , .
,

,
. ,
,
, ,
.
, . 90% , , ,

128

, .
, - . ,
.
Network Monitor (),
, , Application Expert.
( ) .

Network Monitor. . 5-10 5-11
Save Capture Filter Save Address As.

S.iv Capture Filter


jt]

FilejjarnS:
Save $!$$* jCapluie f'ih

'-I

iLJ

. 5-70. Save Capture Filter


Network Monitor
, .
Network Monitor, , URL , , -

129
. , Internet Explorer Done
.
, ,
.

'Budge Broadcast
'BROADCAST
_J PAR5ER5
'BROADCAST
jXjdefault.adi
'BROADCAST
'LAN Managei
'MAC Active Mora
'NETBIOS FunctiC
NETBIOS Mdticc
"Ring Error Monilo"Ring Pararnelei S
iucllO

. 5-11. Save Addresses As


Network Monitor
Network Monitor
Network Monitor : (capture) .
. 5-12,
, .

IG08895316E
005fj3BD3)86B
0050DF0897
(82


- --

. '

.661236

]0497

. 5-12. Network Monitor


, , . . -

130

, .
. 5-13 ,
IIS SQL- .

2,7. . _

' loeis

Qptiore **"

LOCAL

2.2V- - -

D0BOD049iT737

Z.ZO- - -

LOCAL

14

2.20...

LOCAL


CISCO 67?OAO

LOCAL

TCP

0000DQ49C73J

497 =

TC?

[:|j:::

"

Z3

2..--

CISCO 7

LOCAL

TCP

.A..S.

.A. .S.

- . .
. . .
. . .

JDBB3Z
JUWB32
JUUE32

JUlilBS^
JUME3^
JTJBHSi

...

m=-'i i

. AF..

....

. . .

jU*q!3l

. . .

JLWB32

DU5413l

. . .

JUWBIJZ
JUHB3
JOVB3E

."^

JUTilB32

JUTflB^S
JUHB3Z
JijHB3

-JUblB3
JUWE3Z
JUUE^E

:
.. .

in i :::

juiiiB3e

JUMB3?

IU

*1:)1

:51.X2''

j
i:^(j;C

. 5-13. Network Monitor


, , .

Application Expert Compuware


Application Expert

. Application Expert , Network Monitor, .
Application Expert: ,
, ,
. .

131


Application Expert
. . 5-14 (conversation map)
IBuySpy ( ).

.

. 5-14.

Application Expert

(, IIS SQL) ,
.

.
,
, . . 5-6, , IE
IIS 46 , 18 .

132

-i


(bounce)
, . . . 5-15 Default.aspx IBuySpy.

. 5-15. Application Expert


- .
, . . 5-15 , IBuySpy
170 .
, . , 0. . , : 100 , ~
512 , 1024 1024 .

133


, ,
(thread).
. , , . , ,
, ,
Application Expert
. , , . . 5-16 Default.aspx IBuySpy. Application Expert 16 ,
. Network Monitor
Application Expert .

TTP[ffiilMirevbvs,:imagesfliil gtHTIP'l II]

. 5-16. Application Expert

134



Drill Into Packet Trace
.
Network
Monitor.
, , , ( )
(
). ,

, . Default.aspx
IBuySpy . 5-1 7,

. 5-17. Application Expert



(Response Time Predictor)
-

135

. Web-
. . , , .
, ,
, , Compuware.
, .
. . 5-18 Response Time Predictor
I Buy Spy.

1 . -. i .09 I 53 2 2 fin 3 IB 3 5 4 4 5 !. 5 5 f :,-!, 58 7 30

. 5-18.
Application Expert

136

Application Expert
, . , Network Monitor , .
.
Network Monitor Application
Expert. , . Application Expert
.
Network Monitor Application Expert:
1. Application Expert;
2. ;
3. Windows Explorer , ;
4. .


. Application Expert .
. 5-19 , Checkout.aspx
IBuySpy Internet
Explorer US- 15
, US- SQL- 4 .


Application Expert. . 5-20 ,
Checkout.aspx IBuySpy
Internet Explorer US- , IIS- SQL- .

* ft -

a4a32i c*3):4

. 5-19. Application Expert


. 5-20. Application Expert


137

.5

138

IIS SQL-
.
, , ASPX-, SQL-
SQL-. . - SQL Profiler, SQL. time taken IIS US-, Application Expert
.
; edit Vj&* IMCS *g*

"i*S

. 5-21. Application Expert



IIS W3C
Extended Log. -

139

, , ,
.
W3C Log 6.
. ,
. . 5-21 1,3 US- IBuySpy.

Application
Expert
, , .
, , .

,
, WAN-. WAN- Web-
. ,
Web- ,
56 / 500-
.
, (DSL
) -

140

1 .
. ,

. :
56- 200- , 500-
;
256- DSL
50- 200- ;
1 (1,54 \) 50-
100-
;
10- 100-
.
10 , 50 .
. 5-18, Application Expert
. ,
, , . . 5-5

IBuySpy ( ) ,
. 5-5.

56 /

256 /
DSL

1,54 /
T1

10 /

200-500

50-200

50-100

10-50

6-9

2-3

1-1,5

0,5-1

141


, ,
.
, ,
. ,
, , , , , .

Web
Web- Web-,
HTTP- , ,
Internet Explorer. Web- . Web-, Microsoft, Internet Information Server (IIS),
no - Web- Web-, G . 115 Web-, , . HTML, .
, , , ,
.
, .
. , Web .
,
ASP.NET ASP-.
ASP.NET Web- - IBuySpy, VB.NET.

Web-

143

,
Web-.
, , Web-. , ,
Web- ASP.NET,

Web-, Web-.
Web- ,
.
,
US Web-.
Web- , :
IIS no Microsoft Internet Information Services 5.0;
ASP.NET G. Andrew Duthie ASP. NET Microsoft ASP.NET Step
by Step (Microsoft Press, 2002); Jim Buyens .Web Database
Development Step by Step .NET Edition (Microsoft Press, 2002);
ProfessionalASP.NET (Wrox Press, 2001};
ASP.NET Francesco Balena ADO.NET Programming Microsoft
Visual Basic .NF7 (Microsoft Press, 2002); Jim Buyens Web
Database Development Step by Step .NET Edition (Microsoft Press,
2002}; ProfessionalADO.NET (Wrox Press, 2001}.



,
Web-, .
, ,
Web-,
ASP ASP.NET , Web-,
IIS DLL. 6-5681

144

.
ASP.NET
XML, ASP- . XML-
: Web-.

ASP.NET
Web- ASP.NET, IBuySpy, :
ASPX Web-,
ASP-;
ASCX Web-

ASP.NET;
ASMX , Web-cep XML;
VB (code behind) Visual Basic .NET.
Web- Visual Basic .NET Web- Visual Basic. ;
CS VB ,
#. , #, , Web, CS;
Global.asax
,
, Web-
.

ASP.NET
Web- ASP.NET : Windows-, Passport-

Web-

145

. ASP.NET ; : IIS
ASP.NET.
<authentication> Web.config (
).
Windows-
,
IIS, Microsoft Windows. . ; , .
.
, - SSL-, .
-
Windows 2000 HTTP 1,1 (
). , , . . ,
.

Windows- (NTLM)
Internet Explorer
,
. Web- ,

Passport-
Passport- , Microsoft,
, Passport, ( ).

146



Web-, ,
SSL . , ASP.NET
Web.config, .

Windows 2000 Active Directory.


Web- ASP.NET
XML-. , ( ) [ Windows]\Microsoft.NET\Framework\versionx.x.x\
CONFIG\, machine.config. ASP.NET
.


, Web- ASP.NET
.
- Web.config
. Web-
Visual Studio .NET, . Visual Studio .NET, . Web.config machine.config.
, .
. 6-1 , . .NET Framework.

Web-

147

. 6-1.
1
<trace>

, Web.
, Web-. (http://<UAj
>/<(1>/1.\^.) He
false
Web-

<globalization>

, Web- ;

<httpRuntime>


ASP.NET HTTP, , 503,

<compilation>

,
,
, debug,
. Web- debug false

<pages>

SessionState, ViewState ,
Web-

<customErrors> Web- , ,
<authentication>
<identity>

Web-

<authorization> ,

<machinekey>


cookie.

<securityPolicy>
<trust>

,
securityPolicy

. . .

148

. 6-1.

()

<$essionState> HttpModule

<httpHandlers> .
no HTTP
<processModei> Web-
, ,
,
<webControls> ASP.NET

<clientTarget>

<browserCaps>

Web-
Web-
. ,
<customErrors> Web.config ,
,
. ACT
, .
, , IIS 200 (). , , , 302 (). ,
.

Web-

149

, ,
Web.config ,
Web- ASP.NET.

Web- .NET
.NET , Web-. ,
,
US, ASP.NET, ( ).

IIS
IIS , ,
, Web-.
US ,
( ).
, ,
.
IIS, .

IIS . ODBC,
, ASCII-. NCSA Common Log File Format
Microsoft IIS Log Format , .
W3C Extended
Log File Format, , , . , ,

150


. ,
, ,

(, , ).
IIS , W3C Extended
Log File Format, Web-.
,
W3C Extended Log File Format, , .
,
, .

Web- . ,
Web-.
.

W3C Extended Log File Format. ,
s , , Web-.
Software: Microsoft Internet Information Services 5.0
Version; 1.0
ffDate: 2002-05-24 17:25:01
ttFields: date time c-ip cs-method cs-uri-stem cs-uri-query scstatus sc-bytes cs-bytes time-taken
2002-05-24 17:25:01 161.39.207.242 GET /storevbvs/default.aspx 200 12693 373 2516
W3C, #, , , , ,

151

Web-

.
. 6-2,
. 6-2. W3C Extended Log File

s-

cs-

sc-

. 6-3 W3C
Extended Log File Format.
. 6-3. W3C Extended Log File Format

Date

IP-

Time
c-ip

c-username



IP- ,


,
.

s-sitename

IP

-
,

s-computername ,
;

cs-method

(stem) URI

cs-uri-stem

URI

cs-uri-query

Http

sc-status

IP- ,

,
(,
GET)
,
Default, htm
, ,
http
. . .

152

. 6-3.

()

Win32

sc-win32-status
sc-bytes

Windows

cs-bytes

s-port

time-taken

cs-protocol

(HTTP, FTP),
.
HTTP HTTP 1.0,
HTTP 1.1

cs(User-AgentJ

Cookie

cs(Cookie)


cookie
( )

cs(Referer)

,
, ,

IIS
, ,
Log Visits ( }
, . 6-1.
, ,
Web-
. , http://localhost/storevbvs/Default.aspx Web- IBuySpy IIS 16 . 14 ,
Default.aspx. , ,
URL, Web- -

Web-

153

HTTP- ( Default.aspx,
14 ). ,
,
.
images Properties
toiy JDoctiMRTfsj Oiectej) Security! HTTP Headers] Custom
1

When cawcing to ihs resource, the content shoulc coma Item

Help

. 6-1.

Log Visits

,
, . ,
, . , ,
.
, .
,
. ,

. .

154

;) 6


, ,
MS Web-.
1. IBuySpy ,
ProductList.aspx . , ,
.
, ,
, ASPX ProductList.aspx
.
ProductList.aspx :
<@ OutputCache Duration="6000" VaryByParam="CategoryID" %>
<% %>
ProductList.aspx.

<%
V///////////////////////////////////////////////////////////
' : - 4 ProductList.aspx.
- OutputCache,
- .
System. Threading. Thread. Sleep (7000) '7- .

2. IBuySpy.css, Images Productlmages, ASPX.


,
Web-.

Web-

155

3. , IBuySpy .
IIS ,
W3C Extended Log File Format : date,
time, c-ip, cs-method, cs-uri-stem, cs-uri-query, sc-status, sc-bytes,
cs-bytes, time-taken.
4. ,
Browse Microsoft ACT.
Browse -, 3. ,
,
.
HS :
^Software: Microsoft Internet Information Services 5 , 0
Version: 1.0
#Date: 2002-05-30 18:36:11
tfFields: date time c-ip cs-method cs-uri-stem cs-uri-query scstatus scbytes cs-bytes time-taken
2002-05-30 18:36:11 181.39.207.242 GET /storevbvs/Default.aspx 200 0 346 15
2002-05-30 18:36:18 181,39.207.242 GET /StoreVBVS/
productslist.aspx CategoryID=20&selection=2 200 0 377 7016
2002-05-30 18:36:18 181.39.207.242 GET /storevbvs/
Default.aspx test=count 200 0 357 16
, ,
, , . sc-status
. . 6-4 HTTP.
. 6-4. HTTP

2
200
201

:
: ,

. . .

156

. 6-4.

202

()

: ,

203

204

: ,

301

302

: URL

303

304

: ,

400

401

402

403

404

500

:
-

501

502

503

- : ,

( ) 200, , (
).
ASPX time-taken Default. aspx, ProductList.aspx
(, 701 6 ). , .

Web-

157

US
,
Web-. , ,
ASP.NET,
.


ASP.NET , , . , ,
.
ASP- Response.Write. ASP.NET,

ASP-.
ASP-
115
,
, . Web-.
, , . VBScript:
<% Dim t1, t2

' 1 - 1

t1=Timer
>

<% ' 2 - 1
t2=Timer
' ASP.
Dim fso, filename, fileref
filename = "C:\temp\" + cstr(Timer) + ".txt"
' .

158

SET fso = createobjectC'Scripting.FileSystemObject")


SET fileref = fso.createtextfile(filename )
' .
fileref. writeline("1, " + cstr(t1) + "," + cstr(t2) +
cstr(t2-t1)}
' .
fileref .close
ASP- : ,
.
Response. End
,
. Response.End ,
. , , .
ASP. NET
ASP. NET ,
. ="" @
ASPX-. :
<%@ Page ="">
HTML-.
: ,
( VIEWSTATE), . cookie, ,
. ,
, Trace. WriteO Trace. Warn().
, .
,

Web-

159

Web-. MS ,
, ProductList.aspx,
13628 32695 ,

.
G
Web.config .

<configuration>
<system.Web>
<trace enabled="true"
requestlitnit="15"
pageOutput="true"
traceMode="SortByTime"
localOnly="true"/>
</system.Web>
</configuration>
Web.config

HTTP- (Trace.axd). requestLimit , . , , .
ASPX
, MS
, Trace ,
ProductList.aspx.
1. , , Web.config, Web- IBuySpy.

<configuration>
<system.Web>

<trace enablecj="true"
requestlimit="15"
pageOutput="true"

160
traceMode="SortByTime"
loca!Only="true"/>
</system.Web>
</configuration>

2. , ,
, Trace. Warn. , .

' : - 4 ProductList.aspx.
- OutputCache,
- .
Trace. Warn("Find Delay", "Timer 1: Begin")
System. Tnreading.Th read. Sleepf 7000) '7- ,
Trace, Warn("Find Delay", "Timer 1: End")
7///////////////////////////////////////////////////////////

Application Trace
StoreVBVS

Physical Directory: Ci'\StoreVsvS'',3rore1JBVS\

Requests lo this Appbcation

. 6-2.

Browse

Web-

161

3. Browse
Microsoft ACT.
.
4. , Web-, - IBuySpy, URL : http://lo.calhost/StoreVBVS/trace.axd. ,
, , . 6-2.
HTTP (Trace.axd) , II5. , ProductL.ist.aspx, 7 .
Details ProductList.aspx.
Efc

<?>Bsit. *

i"'

(S rites

lays

Help

' Q (2 [JjMJniitiM Q

** & Erjftri.
d p"*3

sffifre j*] wi^.'.lixs'i-^-ii-i-t.Ei.EaHc n.drW-l

Lir!ksB:

Request Details
Request DetaDe
Session Id:
Time nf Requesti
Request Encoding:

6/4/2002 4:45:22 PM
Unicode (UT=-B1

1 1 race Information
Gotflgorv

Message
^53=
aspx.page
asp. oage
asp- page
asp.. page
sspx.paqe
"in<s Dslas
asai oage

Ere init
Begin PreRenaer
End BreRender
Begin SaweViewStete
End SaveViewState
Begin Render
Timer ! us.g-.n
End Binder

JU

tel:a*i.^ja~*-^-l-r.

Request Type:
Status Code:
Response Encoding:

SET
200
Unicode (UTF-B)

^
^
^
^
^
^
^
^
^
^
^
|

O.OQOE09
O.OOOS09
0,009746
0.009238
0.009845
0-00005?
.11677
0.001632
0.011718
0.000041
0.011749
0 000031

a.utssst

J V)7C:f.
7 009754

xiii-

ri.?rJ-iJi'S
0.00273

^der
!

vlHraB.j

. 6-3.

,
Trace. Warn, . , 6-3 Trace Information
Find Delay.

162

, Timer 1: Begin Tinner 1: End. , . ,


, , ProductList.aspx
,
7 , .



Web-
ASP.NET.
.
, , , , Web-.
IIS
8 NS
ASP.NET,
.

Internet Information Services Global (


IIS): File Cache Flushes ( ) File
Cache Hits ( )
. ,
. ,
. ,
.

Internet Information Services Global (


IIS): File Cache Hits % ( )

. Web-, , , , 80%.

Web-

163

Web Service (-): Bytes Total/sec ( ) ,


Web- . , US .

Web Service (-): Connection Refused (


) , . , .

Web Service (-): Not Found Errors (


) , , ( HTTP 404).
ASP.NET
ASP.NET Web-.
ASP.NET ASP.NET.
, .
,
.
ASP.NET

.NET Framework. Web Microsoft MSDN no .NET


Framework.
, , Web- .NET.

Application Restarts ,
Web-. -

. 0 IIS w3svc.

Requests Queued , . , , , -

164

Web-
.
Requests Rejected , - . , HTTP 503 (Server is too busy). 0.
Request Wait Time
. .
ASP.NET

ASP.NET ,
ASP.NET.
_Total_, Web-. _Total_ . , 0.
Cache Total Turnover Rate
. .
Errors Total ,
HTTP-. Web- .
Request Execution Time , .
.
Requests Failed ,
(HTTP 401)
(HTTP 404 414)
(HTTP 500).
Requests Not Found
- , (HTTP
404 414).

Web-

165

Requests Not Authorized , - (HTTP 401).

Requests Timed Out


-.

Requests/Sec , .

.
MS,
ASP.NET,
Web- ASP.NET.



.
ASP.NET, ,
, . ,
, , ,
, , Web-.


Web-,
Web-,
, . ASP.NET ASP-, no- .

, . -

166

no- ASP.NET,
, ASP, ,
. Web.config (trusted)
. . V no- :
Web-cep.

, Web- .
Web-
. , (HTTP), ,
Web- HTTP-cookie,
. Web-
Web-, ,
cookie ,
.
ASP.NET , Web- , Windows
SQL Server. ,
, . Machine.config

. ASP.NET
, ASP-, , . Web.config ,
, .

Web-

167


<%@ Page EnableSessionState = "False" X>.

ASP.NET
ASP.NET
. ASP

, . ASP.NET .

. , API , .

ASP.NET,
,
. ,

. , ,
ASP.NE Applications\Output Cache Turnover Rate\Total.
.

ASP.NET

.
. , , , ,
. .

168

OutputCache. , 60 ,
:
<%@ OutputCache Duration="60" VaryByParam="None">!>
Duration VaryByParam .

,
Duration 60 ,
,
.
, , , Cache, (.
API ). VaryByParam
. , s .
None VaryByParam -
.
, *. , , , . ,
.
, . ,
ProductCategory Product,
:
<@ OutputCache Duration="10"
VaryByParam="ProductCategory;Product"X>

Web-

169

!' .,. OutputCache


; Location, VaryByCustom
Vary By Header. Location , (, ). VaryByHeader , a VaryByCustom ,
Browser,
.


.
, , . ,
. , ,
.
Output , . Duration VaryByParam
, . ,

VaryByControl,
.
<%@ OutputCache Duration="60" VaryByParam="None"!<>

API
API
, . , ,

170

.
,
API .
:
Cache("mydata"}() = "some data"
,
. :
X = Cachefmydata")
Remove, , Insert,
. Remove:
(Cache. RemoveC'mydata"))
Insert Cache (overloaded]
. ,

, 120 :
Cache.Insert("mydata", mydata, nothing, _
DateTime.Now.AddMinutes(120), TimeSpan.Zero)

,

,
. ,
, ,
. ,
10
, Insert :
Cache.Insert("mydata", mydata, nothing, DateTime.MaxValue,
TimeSpan.FromMinutes(IO))


(ViewState) (, ) ,

Web-

171

, .
Trace ,
Web- .NET.
, , Web-. ,
.
EnableViewState="false"
.

ADO.NET
Web- .

,
,
. ADO.NET.
, .
.
ADO.NET , .
.NET Framework (data
provider): OLE DB .NET Data Provider SQL Server.NET Data
Provider. OLE DB .NET Data Provider
, OLE DB, Microsoft SQL Server
Oracle, ,
SQL Server. , Microsoft
SQL Server 7.0 , SQL Server. SQL
Server , .

SQL Server .NET Data Provider SQL Server 7.0 .

172

SqlConnection
. SQL Server SqlConnection. ,
VB.NET, SQL Server
Pubs:
Dim strCnStr As String = "Data Source = . ; " _
& "Integrated Security=SSPI;"
& "Initial Catalog = Pubs"
Dim objCn as New SqlConnection(strCnStr) _
objCn.Openf)
,
, , . . , ,
. -
.NET . .NET .
, ,
, .



,
, .
, .
,
.
min max, , , Web-. -

Web-

173

cuu ,
, - (
15 ). :
Dim strCnStr As String = "Data Source = . ; "
& "Integrated Security=SSPI;"
"Initial Catalog = Pubs;"
4 "Min Pool Size=10;"
& "Max Pool Size =100"
, , . ,
blob image. , .
:
Dim strCnStr As String = "Data Source = . ; "
& "Integrated Security=SSPI;"
& "Initial Catalog = Pubs;"
& "Packet Size=32768"
SqICommand
Web- , / . SQL Server
SqlCommand/DataReader DataAdapter/DataSet,
.
SqlCommand/DataReader;
SqlDataAdapter/DataSet , ADO.NET.
SqlCommand/DataReader , , ExecuteNonQuery,
ExecuteScalar Execute Reader. , SqICommand
ExecuteXmlReader , XML.
( VB.NET). - NorthWind,
Microsoft SQL Server.

174

ExecuteNonQuery
Insert,
Update Delete. . , /
, .
,
Customer NorthWind:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Module ExecuteNonQuery
Sub HainO
Dim strConnString As String = "Data Source=.;"
& "Initial Catalog=Northwind;"
& "Integrated Security=SSPI"
Dim strSQL As String = "GetNumberOfCustomers"
Dim sqlConn As New SqlConnection(strConnString)
Dim sqlComd As New SqlCommand(strSQL, sqlConn}
sqlComd.CommandType - CommandType.StoredProcedure
sqlComd.Parameters.Add(New
SqlParameter("@i", SqlDbType.Int))
sqlComd.Parameters(O).Direction =
ParameterDirection.ReturnValue
sqlConn.Open()
sqlComd.ExecuteNonQuery()
sqlConn.Closet)
Console.WriteLine("Number of customers = {0}",
sqlComd.Parameters(O).Value, Integer))

End Sub

End Module

ExecuteScatar
,
, . -

Web-

175

Customers
North Wind:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Module ExecuteScalar
Sub MainC)
Dim strConnString As String = "Data Source=.;"
& "Initial Catalog=Northwind;"
& "Integrated Securtty=SSPI"
Dim strSQL As String = "select count(*} from customers"
Dim sqlConn As New SqlConnection(strConnString)
Dim sqlComd As New SqlCommand(strSQL, sqlConn)
sqlConn.Open()
Dim As Object= sqlComd.ExecuteScalarO
sqlConn.Close{)
Console.WriteLine("Number of customers = {0}",
CType(o, Integer)}
End Sub

End Module

ExecuteReader
,
,
. , .
Customers NorthWind
,
.
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft,VisualBasic
Module ExecuteReader
Sub Hain()
Dim strConnString As String == "Data Source=.;"
& "Initial Catalog=Northwind;" _

176

6
& "Integrated Security=SSPI"
Dim strSQL As String = _
"select customerid,contactname,phone from customers"
Dim sqlConn As New SqlConnection(strConnString)
Dim sqlComd As New SqlCommand(strSQL, sqlConn}
sqlConn.Openf)
Dim sqlDfi As SqlDataReader = _
sqlComd.ExecuteReader(CommandBehavior.CloseConnection)
Do While sqlDR.ReadO
Console.WriteLine(sqlDR("customerid").ToString() _
& ControlChars.Tab _
& sqlDR.GetSqlString(1).ToString() _
& ControlChars.Tab _
& sqlDR.GetSqlString(2).ToString())
Loop
sqlDR.CloseO
End Sub

End Module
,
, SingleRow ComtnandBehavior :
Dim sqlDR As SqlDataReader = _
sqlComd.ExecuteReader(CommandBehavior.SingleRow);

,
, .
. , ,
, SQL Server,
. , GetSqtString
Getlnt32,
SQL Server , .

Web-

177

ExGcuteXMLReader
, SQL Server
XML. , XML,
SQL , SQL
Server :
Imports
Imports
Imports
Imports

System
System.Data
System.Data.SqlClient
System.Xml

Module ExecuteXmlReader
Sub Main()
Dim strConnString As String = "Data Source=.;"
& "Initial Catalog=Northwind;"
& "Integrated Security=SSPI"
Dim strSQL As String = "SELECT customerid,"
& "contactname,"
& "phone "
& "From customers "
& "FOR XML AUTO"
Dim sqlConn As New SqlConnection(strConnString)
Dim sqlComd As New SqlCommand(strSQL, sqlConn)
sqlConn.Open()
Dim xmlR As XnuReader = sqlComd.ExecuteXmlReaderQ
Do While xmlR.ReadO
Console. WriteLine(xmlR. ReadOuterXmlO)
Loop
xmlR.CloseO
sqlConn.Close()
End Sub
End Module

Web-
Web- ,
- ,
,
. -

178


, ,
,
Web-, .
,
: . .
, , . , , .

, Web- . ,

, ." . ( 115) -
. ,

. ,
, -.
,
. Web-
,
Web.config Trace
O&bugf , :>/!
. .

Web-

179


Web-
.
US-, . , Web-, , - , . .
,

. ,
, :
Web- , ;
HTML , , ;
.


Web-.

, ,
Web- .
, . , . - - , . ,
Web-, .

, ,

180

.
, , , . , , ,
HTML-
(, , , ..). , , URL, 68 :
http://yoursite/goodoldunitedstatesofamerica/northcarolina/pictures/
,
41 :
http://yoursite/us/nc/pics/
SSL
SSL Web- .
SSL
, .
20- 30- SSL. , SSL . SSL
, , , , .

.
,
. , Response.Execute , no- ASP/ASPX
Response.Redirect, . Web- .NET, -
.
.N StringBuikler,

Web-

181

Web-
( ) .
Web- Web- . , , Web-.

,
?
: (scaling out)
(scaling up). Web-. . , , .
, , .

Web-
Web-
, . , ,
, SQL-
Web-, .
: , -

182

(, , ..}.
,
.

Web- Web- , , , ((
, .
,

. . ,
.


.
. , , ,
.

Web-
Web-
. : ,
. 2 Web-. Web-
.
Web-

Web-

183


, 9.
Web-
, . , SQL- ,
US-, SQL. He
Web-, US , SQL- .


, , , , .
, .
,
. , , , , , 5%. , Web-.

Web-

Web- Web-. , Web- . Web-,
Web- .

,
Microsoft, Network Load Balancing (NLB). NLB

184

, , Windows 2000 Advanced Server, Windows 2000 Data Center Edition Windows .NET
Server.
Web- .
http://www.microsoft.corn.

, , Web-, Web-. , , Cisco, F5 Labs Extreme Networks.
Web- .

Web-, Web-. IIS System Monitor, ,


.
ASP.NET. , , , ASP. NET, , ! , .


(common language runtime,
CLR). CLR, Web-
.NET, , Web- .NET.
, , Microsoft : DevPartner Studio
Compuware Appmetrics Xtremesoft.

CLR
CLR .NET Framework,
, , .NE7~(.NET managed code). .NET- CLR
Windows,
, , , , , .
,
CLR .NET-
, .
,
Microsoft , -

t86

CLR.

Microsoft Intermediate Language


.NET-npu ,
, . , .NET (, Visual
Basic .NET, C + + .NET #) MSIL (Microsoft Intermediate
Language], G
(assemblies) ,
, MSIL,
(manifest).


ilaasm.exe, Microsoft .NET Framework.
MSIL CLR. , , , CLR
, .
, CLR
, .
, .


MSIL- . ,
CLR , (Just-in-Time Compiler, JIT).
, .
,
JIT . ( ,

187

.) , CLR
, . . ,
, .
, ,
. ,
.
Web-, ASP. ASP go ,
. ASP

, ASP.NET.
.

. Microsoft
, , JIT, .
, ,
. JlT- ,
, , .
, :
, , . , JIT , ,
, , , .

JIT , .N7 CLRJit.

788


.NET Framework ngen.exe,
MSIL
.
(Pre-JIT), : ,
?
, . Web-
( ), . ,
.

, JIT , .
.NET , , , ,
,
Web .

Web- .NET
, JIT, , CLR
. , CLR, ,
CLR , MSIL, , CLR.


CLR ,
, (AppDomains),
CLR ,

189

. , ,
,
. ,
.


.NET-
, - DLL Windows. , , , . .
, .
,
. , , ,
, , .

, , , ANSI Unicode.
CLR,
. ( .) CLR
, . , , , . ,
,
(pinned).

,
--

190

,
.
# of marshalling .NET CLR Interop ,
.

CLR , .
, CLR
, .
,
.

, , ,
.
,
.
, , , 0, 1 2. , , . ,
, , 256 , 2
10 , .
.
, . , . . , , (

191

). . : , , , , , , .

:

,
? ,
20
, ,
.
.NET ClR Memory
.
, , . , , , . , ,
. , ,
. , ,
.
, , .
, , ,
,
. , , .
,
. .

192

: ,
. ,
, ,
,
.

,
.
,
. :
,
,
. , , ,

.
:
,
.
, , ,
, .
, ,
, System.OutOfMemory Exception.

- .

. , ,
.

, , , -

193

. . , ( )
. , , .
, . , , , ,
.

,
. ,
,
(final ization).
. ,
, , . ,
, , . ,
. , , - .
, . Finalization Survivors .N7 CLR
Memory. , ,
. Promoted Finalization .NET CLR
Memory.
, .

194


, , ,
,
.
.
, , , , Web-, . ,
, .
, Microsoft . : CLR Workstation CC (mscorwks.dll)
, , Server GC (mscorsvr.dll).


Web- Server CC.


, ,
(, ). , CLR
.

. CLR , , , . ( ,
;

195

,
.)
, main() foo(), barf), System.FileNotFoundException,
,
CLR . <) System.DivideByZeroException. FileNotFoundException
, CLR . , bar(),
,
, ().
foo(). , foo() System.FileNotFoundException. , .
(throw-to-catch depth),
, CLR
, 1.
() ,
, CLR mainf), 2.
,
,
.
, .
,
, , , ,
.
, foo() bar()
,
, . bar(), foo(), .

196


,
, .NET-
CLR . .NET, CLR ,
.
, CLR, CLR .NET.
.NET- # of Exceps Thrown. Throw to Catch Depth
.NET.
.

. CLR , . ,
.
, .
, . .
, ? , , -
.
, ,
, ,
.

.NET
, .NET Framework, Web-, .NET,

197

.NET Framework . ,
, . , /
. , .
: Web- .NET.
, ,
.NET, , .NET.

,
, System.Diagnostics.PerformanceCounter.
.NET CLR Memory
, .NET
framework . ,
Web- .NET
.NET,
. , . ,
, .
# GC Handles
# GC Handles , .
, CLR. ,

. - Web-.

198

, ,


GC. , , Web- GC,
.
# Gen 0 Collections
. # Gen 0 Collections ,
.
. , ,
,
, . .
,
.
# Gen I Collections
,
.
# Gen Collections. , , . , .
# Gen 2 Collections
, .
, , # Gen 2 Collections
.

199

Web- aspnet_wp. ,
. .
# Total Committed Bytes
, . ,
.
% Time in GC
, .
, , , .
Gen 0 heap size
Gen 0 heap size ,
. , . , , GC .
Gen 0 Promoted Bytes/sec
, . , , ,
.
# 1 heap size, ,
.
Gen 1 heap size
,
Gen 0 heap size , ,

200

.
# 0 Collections.
. ,
.
Gen 1 Promoted Bytes/sec
Gen 1 Promoted Bytes/sec 1 2. Gen 0 Promoted Bytes/sec, Gen 1 Promoted Bytes/sec
Gen 2 heap size.
.
Gen 2 heap size
. , .

.NET CLR Loading


.NE CLR Loading
% Processor Time (% ! ,
.NET-, , .
Total AppDomains
(AppDomains), .
,
,
CLR . Web-

201

aspnet_wp. G
, , , .
. ,
, .
4, . , 15 000 .
Total Assemblies
,
.
-, , -,
.
-, .
- , .
, .
Total Classes Loaded
, . , . ,
.
.NET CLR LocksAndThreads
, ,
.NET CLR LocksAndThreads.
.NET CLR LocksAndThreads,
.

202

Contention Rate/sec
,
. ,
.
Total # of Contentions
, CLR.
Current Queue Length
,
. ,
, , ,
. , , .

.NET CLR Exceptions


,
, . .

. , , . .NET CLR Exceptions. , Exceps Thrown/sec.
100 , .
# of Exceps Thrown
, . .NET, ,

203

.NET- (, - .NET System.NullReferenceException). , .


, , , .
,
. .

,
.
# of Exceps Thrown /sec
,
. .NET-, , .NET- , . , , . , ,
100 ,
, .

.NET CLR Security


, Web-, ,
.
, .
, , . .NET Framework
,
.

204

# Link Time Checks


, . ,
, . ,
. , . ,

(Code Access Security, CAS)
.
, , ,
.
% Time in RT checks
, CAS , .
, . ,
.
( Stack Walk
Depth )
.
Stack Walk Depth
CAS . . , , ,
, ( D). ,
1. D,
, ,
4.
Total Runtime Checks
CAS
. CAS

205

. .
Stack Walk Depth,
.
.


, ( ) DevPartner Studio 7.0
Compuware. , DevPartner
Studio, .

Compuware DevPartner Studio


DevPartner Studio Professional Edition Compuware Corporation

. ,
. DevPartner Studio 7.0 Professional Edition http://www.compuware.com/products/
devpartner/.
DevPartner Studio
.
, ,
.
DevPartner Studio : Visual Basic,

206

Visual C + +, Visual Basic .NET, C#, Visual C, C/C+ + , Web ASP.NET, (Script VBScript
IE IIS.
DevPartner
Studio .
,
Performance Analysis.
Instrumentation Manager .
( ), .
. , .


, Exclude System Images DevPartner Performance and
Coverage Exclude Images. ,
. .NET Framework.
Session
Session,
. 7-1. , , .
, . , C + + # . , (, 20 ),
,
. ,

207

, .
. 1 ...^. .^

- (||( Modulus !!7MBttoj5 :, ,


Jjj R5RAIGHT_W2t: - : (Drivel)

nleinudl.!} jsoncsln

!' 13 System(91.2%)
Top ZO Source Methods
H Top20MhPds
" '] 11^1
" Called Methods

',*n

j ]*#! !

_4^>n*;*ijct ^.|_ ,iregnedril,drs4ndir,:,ong)


c
SpftedBumo Dr i.-c> . jr
..etc. .
SpeedBurnp Cf-er.Far
Mel
CjulcfrjortOnt.inlj
5peed8urno D-4r.Fo
-
5peed6urna O"Sr.Fo
f.jl-eCppRr Ckc<
UtiveCppSpMlBljnpC lug
[.
5peedBump Driver. Fo
.FormLLaad
SpeedBump Driver. Fo
VBdjlNetBtnj: :1
:pe?1hump Driver. Fo
Ma-agedCppHn_O<*
P
P
P
-

, ...... '^.jg -- ?

'"J(5*!<5&5)

0.9
0,5
0.4

21. S
31.5
11.0

9.109
302
[

0.0
0.0
0.0

60.2
0.7
0.5
33.3

L
799
1
1

0.1

::.i

o.o

;2C
25.2S1
1.999
(
3.56
119

0.0

0.0

^-0.0
0.0

0.0
0,0
0,0

1
0

. 7-1.

Session DevPartner Studio

"'7!-!^^^' :
1

*t

U w

Prnip.t

iff- ' -J ' 1- ;

&jiW

*""-,"*

t^'bij'j

f - ih

L-i^^

]ft'-^^w

I'"

^ Performance anah,,-,

: -

^iDJ^J

^
-',

t -'ebua
-

ft

.M

-.:

.-;..

"^^'*??
ii

?(

Orwpr.dCTFf
-tod y:l
Counl

79 213
73 213 =
73 213 :
73

213 E

78 213

te >1*!-;.-1( ; SBSSDC SirinawJ


Si.wiih duldjeri

0.2 '

1..?9

14 122.1

1.7
139 3 4 1 . 6
6 . 0 485 0 9 2 . 9
1.1 ;
69 3 5 3 . 4

78 218

D.2 !

78 213
T6 21

ss=

18 7 5 3 . 6

_^

1.4 ! 112 654.1


4 . 1 : . 241.1
1.0
82 013. 1
2 . 0 . 165 624.1

IS 216

- G e t b l g l t e m (cjhHndDlcj, ICC PICTUHZBOX) ;


HDi: hDC - () ;
MoveToEx (hDC, 0, 1, NULL ;
HPEK hOldPen - (HPCH) S f f l f f g t O b j e o t l h D C , GetScccltOfcJect ( E L A C
Select Object ( h D C , GelStocrteCbject (TJHITE P E N ) ) ;
LineTo ( h D C , aiEleHirnt.3, 11:
SeleccCbJeec (hDC, hOJdPenl ;

>

Jj|

. 7-2. Source Code DevPartner Studio



, ,
. Session ,
. . 7-2 i-568'

208

, , ,
() , , . , , .
Method Details

, . , . ,
, , (. 7-3).

.
Parents , ,
Children , .
Method Details

, ,
.

. 7-3. Method Details DevPartner Studio

209


DevPartner Studio
, ,
Web. . Web- DevPartner
, Visual Studio .NET,
, IE IIS.
DevPartner
, .
. DevPartner ,
:

DCOM ;

HTTP-,
IE, I IS.

DCOM, HTTP (IE IIS), DevPartner


.
. Method Details
.
/
IE MS , Correlate
Performance Files, Tools DevPartner, .
.NET
.NET Framework .
, .
, . , , 95%

210

.NET Framework. ?

DevPartner Studio.

, . ,
Web- ASP.NET , .
,
, , . ,
,
, . :
odd name="OutputCache" type="System.Web.Caching.OutputCacfieModule''/^

.NET Framework . , , , , Clear


Session Control, .
, .
.NET Framework

% with Children Method List


Source, , .NET Framework.
Child Methods Method Details .NET Framework, , , , ,
.NET Framework.

Web-, - , Web-, -

211

. DevPartner Performance Coverage


Remote Agent .
C/C++,
. , , , .NET Framework, ,

AppMetrics
.NET Enterprise Services
+ - ( )
.
Enterprise Services .NET Framework. , , . . .
AppMetrics for Transactions (AppMetrics) Enterprise Services, , +. , ,
,
+ . AppMetrics , + .
AppMetrics Enterprise Services. , , .
AppMetrics Manager
AppMetrics . , ,
, Enterprise Services. -

212

AppMetrics
,
.
,
.
. , , , .
, ,
, .
AppMetrics

nog Enterprise Services .
1. AppMetrics Manager
Manager.

. 7-4. Diagnostics Application

213

2. Agent Manager,
Agent .
3. () .
4.
.

AppMetrics

AppMetrics
Diagnostics Monitor,
.
Diagnostics Monitor , , . , . ,
,
.
, , .
,
- .
. 7-5 AppMetrics for Transactions,
:
;
FMStock7.DAL.Broker,
FM5tocks7.CAM.7;
CreditAccountBalance,
;

214

(crossapplication calls).
.
FMStocks7.GAM.7 .

14257125 4443355375

. 7-5.

, ,
.
,
, . , ,
.
, , ,
, , .
. , ,
.

,
. . 7-6
AppMetrics, FMStocks7.GAM.7 10 .
,
.

215

. 7-6.
, , . . 7-7
AppMetrics for Transactions, 4-
.

. 7-7.


Enterprise Services *
AppMetrics Production Monitor,
Enterprise Services. , Diagnostics Monitor. Production
Monitor
, 7-8, 7-9 7-10.

. 7-8.

216

..j

Component Rice (Started. Completed, Abortid)

-Completsd
- Aborted

. 7-9.

. 7-10.
, Production Monitor , , .
AppMetrics Enterprise Services. , FMStocks7.GAM.
Production Monitor .
, .
AppMetrics ,
, -

217

SNMP. , AppMetrics ,
.

. 7-11. Application Process Runtime

jJjConstjIeRw*
I s Curtis
Hur^mtjon Lotff1
j Application Monit

--^ Logging Options


Dot Net diagnostics testing m

. 7-12. Components Process Runtime

218

AppMetrics Enterprise Services. . 7-12 , FM5tocks7.DALBroker


10 .
,
.


Web- .NET. , System Monitor .NET. .
,
Writing Scalable Code
(Simon Meacham) (Mike Parks),
Microsoft Press .

, . .NET-
, SQL- . , SQL-,
. , ,
. ,
- -
.
SQL-.
, Microsoft . ,
SQL .
, , , .
IBuySpy, .

Pentium 111 1 1 ,
Microsoft SQL Server 2000 Enterprise Edition
Service Pack 2 Windows 2000 Advanced Server Service Pack 2.

220

, . SQL Server 2000, Transact-SQL (T-SQL); SQL Server,


; SQL Server
. , SQL Server 2000 , , SQL Query Analyzer SQL Profiler. ,
:

SQL Server Books Online ( SQL Server


2000);

Kalen Delaney Inside Microsoft SQL Server 2000 (Microsoft Press,


2000);

Ken Henderson The Guru's Guide to Transact-SQL (Addison


Wesley Longman, 2000);

Microsoft SQL Server 2000 Performance Tuning Technical Reference (Microsoft Press, 2001).

,
.
, ,
, SQL. 3,
Microsoft Application Center Test,
.
,
, ,
. ,
, , .


SQL- . ,

SQL-

221

Web-, .

Web-, , ,
SQL-.

,
, Web-
SQL-. ,

.
SQL-,
Web-, , .
: ,
. ,
SQL-,
. ,
SQL Server 2000.


, SQL, , SQL Server 2000.
SQL
Profiler, SQL Profiler SQL Query
Analyzer; , ,
, System Monitor. .
SQL Profiler
SQL Profiler ,
Programs\Microsoft SQL Server\Profiler.


SQL-.

222

SQL Profiler, . .
4 General, Events, Data Columns u Filters,
,
General , , SQL-.
, , .
Events , . , .
. ,
, , , .
:

Stored Procedures: SP:StmtCompleted, SP:Completed,


RPC:Completed TSQL: SQUStmtCompleted, SQL:BatchCompleted , , RPC (batch i.
, , ,
.
:
;

Stored Procedures: SP:Starting, SP:StmtStarting u TSQL:


SQUStmtStarting , . , . ,
, , ;
Sessions: Existing Connection
SQL Server
. -

SQL-

223

. , (view) ON
ARITHABORT,
, ;
Stored Procedures: SP:Recompile , .
.
,
. ,
. ,
, SP:
Starting;
Lock: Timeout and Lock: Deadlock , . -
;
Errors and Warnings: Attention
,
-. , , , ,
- . , ADO.NET CommandTimeOut 30 ( ) , ;

Errors and Warnings: Missing Column Statistics SQL Sewer



.
. , , ;

224

Errors and Warnings: Missing Join Predicate


, ( ). .
,
;

Errors and Warnings: Exception u Error Log , . ,


. , 1204 3605, SQL
Profiler , .
, .

event classes SQL Server Books Online.


Data Columns , . 43 Event Class u SPID.
SQL-
. , ,
. ,
, , 5:ieted', SP:5tarting . , . 8-1:
. 8-1.

Event
Text
CPU

. , , . .
SQL-.
,

. . .

SQL-

225

. 8-1. ()

Reads

Writes
,
SQL-
Duration
,

StartTime

EndTime
. ,

NestLevel
. ,
,
1, - 2.
@@NestVa!ue
Application Name ,
HostName
, , SQL
NTUserName
Windows,

LoginName
Windows, SQL Server
data columns SQL Server Books Online.
Filters
. , ,
. , SQL Profiler,
. , Filters Trace Properties.
,
, ,
, ,
. SQL Profiler , SQL-.
,

226


SQL-. .

fn_trace_gettabfe.
, 1000 trace.trc :
SELECT * FROM ::fn_trace_gettable('c:\trace.trc',
default) WHERE Duration > 1000
fn_trace_gettable -- SQL Server
Books Online.
,
, N ,
,
. ,
, .

,

. ,

, .
, ,
. SQL Profiler ,
, .
. : File Choose New Trace Template, no

SQL-

227

Trace Properties,
, .
General Save As. Open Trace Template File
. ,
System Monitor
SQL Server
System Monitor. 4,
, , , , , .
, SQL Server.
, . . SQL Server:

SQLServer:Buffer Manager

Buffer cache hit ratio ,


( -).

;

SQLServenGeneral Statistics Object


User Connections SQL-. ;

SQLServer:Locks
Lock Requests/sec
.
;
Lock Timeouts/sec , - .
0;

228

8
Lock Waits/sec ,
, 0;
Number of Deadlocks/sec ,
. . 0.
,

. ,
, (lock hint), , .

SQLServer:Memory Manager
Memory Grants Pending ,
(workspace).
,
, , , ;
SQLServenSQL Statistics
Batch Requests/sec rs
, ;
SQL Compilations/sec . . Batch requests/sec
fad-hoc) SQL-;
SQL Re-Compilations/sec . .

.

.
SQL Query Analyzer
SQL Query Analyzer ,
SQL- , ,

SQL-

229

. ,
SQL Server 2000, Query Analyzer
.
Query Analyzer .

. , - .
,
,
-' . =
:
sysindexes:

SELECT ., rows
FROM sysoiajects INNEfl JOIN sysintJexes i on o.ld * i.id1
= WHERE i.indid < 2
f ORDEfl BY o.rtatns
{!

'
\
''

sysindexes " *
, -*'
. , ,
, - sysint/exes. , '
. sysindexes* , .


,
, . ,
, , . ,
. ,
,

230

,
.

; ,, ,
. , ,
SQL Server, ,
. ,
.
.

, ,
( )
SQL-.
, ,
sysprocesses
master. 8-1 SQL-, , (root blocker).
8-1
- sysprocesses.
SELECT spid, blocked, status, waittime,
waittype, wait resource, db_name(dbid) DatabaseName, cmd,
hostname, loginame
FROM master..sysprocesses
WHERE blocked != 0
DECLARE @spid int
- spid .
SELECT @spid = A.spid
FROM master..sysprocesses A
INNER JOIN master..sysprocesses
ON A.spid = B.blocked
WHERE A.blocked = 0
IF NOT @spid IS NULL
BEGIN
-- .

SQL-

231

DBCC INPUTBUFFER(@spid)

END

- IBuySpy, ,
SQL-.
, .
:
CREATE PROCEDURE ProductCategoryList_Recompile
WITH RECOMPILE
AS
SELECT
CategorylD,
CategoryName
FROM
dbo.Categories
ORDER BY
CategoryName ASC

GO

. 3, SQL-
ACT. ACT 8-2.
8-2
-- ACT
.
Dim oConn
On Error Resume Next
Set oConri = CreateObject{"ADODB.Connection")
oConn.Open "driver={SQL Server};Server=SQLServer;" & _
"Database=Store;uid=user;pwd=user"
If err.Number <> 0 Then
Test.TraceC'Error Opening connection: " & _
err.number & ", " & err.description)
ELSE
oConn.ExecuteC'EXEC ProductCategoryList_Recompile")

232

8
If err.Number <> 0 Then

Test.TraceC'Error Executing: " &


err.number & ", " & err.description)
End If
End IF

10 . 8-1 , .
waitresource :
TAB: 7:1173579219 [[COMPILE]]

"7" "TAB:" Store, a "1173579219" . "1173579219"


ProductCategoryLi$t_Recotnpile.

SELECT Object_Name(l 173579219)
Store. ,
waitresource
,
.
, ,
KaKProductCategoryUst_Recompife.
sysprocesses ,
, .

. , . .
, .

SQL-

233

, SQL Server,
. ,
,
. ,
, - ().
SQL-,
spjock
. spjock
, ,
. spjock
..
, spjock_verbose,
The Guru's Guide to Transact-SQL.

.
:
CREATE PROCEDURE ProductCategoryList_XLOCK
AS
-- ,
BEGIN TRANSACTION
SELECT

CategorylD,
CategoryName

FROM
dbo.Categories (XLOCK)
ORDER BY
CategoryName ASC
WAITFOR DELAY '00:00:01' -- 1 .
COMMIT TRANSACTION
GO

234

spjock
, :
spid

dbid

Objld

Indld

Type Resource

Mode

Status

51
53
53

7
1

0
0

.
J

i
i
'/
7

1977058079 0
1977058079 0
1977058079 (i
1977058079 0
1977058079
1977058079 0

DB
DB
RID

S
S

[X

GRANT
GRANT
WAIT
GRANT
GRANT
GRANT
GRANT
GRANT

53
53
54
54
'..'I

;
J

1 89:0

89

PAG
1
i AB
RII
RID

JX

I 89:2
!

:89:6

IX
X

( )
Objld, Type, Mode Status. ,
RID (row identifier) 1977058079. R[D KEY
Categories.
, WAIT Status,
.
SELECT
Object_Name(<Ob]Id>), 1977058079 Categories. sysprocesses
spjock
'
.

,
, ,
. , .
.
, .
.
. ,

SQL-

235

. .
(1204) SQL Server (3605)
(-1):
DBCC TRACEOMC-1, 1204, 3605)
ErrorLog SQL Profiler
Enterprise Manager. ,
, :
CREATE CLUSTERED INDEX IXC.ModelName

ON dbo.Products (ModelName)
GO

CREATE PROCEDURE ProductsUnitCostUpdate.DeadLock


AS

BEGIN TRANSACTION
SELECT *
FROM
dbo.Products (HOLDLOCK)
WHERE ModelName = N'Bullet Proof Facial Tissue'
WAITFOR DELAY '00:00:05'
UPDATE dbo.Products
SET UnitCost = UnitCost * 0.90
WHERE ModelName = N'Bullet Proof Facial Tissue'
COMMIT TRANSACTION
GO

SQL Query Analyzer . ,
1204:
Deadlock encountered .... Printing deadlock information
Wait-for graph

236

Node:1
KEY: 7:2041058307:1 (a60421ba9ed3) CleanCnt:2 Mode: _
Range-S-S Flags: 0x0
Grant List::
Qwner:0x42be1340 Mode: Range-S-S
Flg:OxO flef:0 Life:02000000 SPID:52 ECID:0
SPID: 52 ECID: 0 Statement Type: UPDATE Line #: 12
Input But: Language Event: ProductsPriceUpdate_DeadLock
Requested By:
ResTypeiLockOwner Stype:'OR' Mode: X SPID:51 ECID:0
Ec:(0x42f77568) Value:Ox42be1360 Cost:(0/0)
Node:2
KEY: 7:2041058307:1 (a60421ba9ed3) CleanCnt:2 Mode: Range-S-S _
Flags: 0x0
Grant List:;
Owner:Ox42be5240 Mode: Range-S-S
Fig:0x0 Ref:0 Life:02000000 SPID:51 ECID:0
SPID: 51 ECID: 0 Statement Type: UPDATE Line *: 12
Input Buf: Language Event: ProductsPriceUpdate_DeadLock
Requested By:
ResTypeiLockOwner S t y p e : ' O R ' Mode: X SPID:52 ECID:0 _
Ec:(0x430b5568) Value:Ox42be1260 Cost:(0/0)
Victim Resource Owner:
ResType:LockOwner S t y p e : ' O R ' Mode: X SPID:52 ECID:0 _
EC:(0x43065568) Value:Ox42be1260 Cost:(0/0)

1204 ,
. Key:, Mode:
Input Buf:. ,
.
1204 . SQL Server Books
Online u Inside Microsoft SQL Server 2000.

,
. ,
.
.

SQL-

237

INF: How to Monitor SQL Server 2000 Blocking (Q271509) no


http://support.microsoft.com/defaultaspx?scid = kb;enus;q271509;
INF: SQL Blocking Due to [[COMPILE]] Locks (Q263889) no
http://support,microsoft.com/default.aspx?scid = kb;enus;Q263889;
INF; Troubleshooting Application Performance with SQL Server
[Q224587) no http://support.microsoft.com/default.aspx?scid = kb;en-us;Q224587.


, ,
. SQL-,
, . ,
, SQL Server 2000. , SQL Server, , ,
, ,
SQL Server, ,
, ; ,
SQL Server.
, , . SQL-. , , .


,
SQL Server 2000.
Query Analyzer.

238


, 100000 Orders
1000000 OrderDetails - IBuySpy. SQL-
-
. , , . SQL Server no-; . 8-3
.
8-3
,
SET NOCOUNT ON - ,
DECLARE @Count int
DECLARE eOrderlD int
DECLARE CustomerID int
DECLARE @DateAdd int
DECLARE @DateAdd2 int
DECLARE Today DateTime
DECLARE @SQL nvarchar(4QOO)
-- .
SELECT Count(*) Orders FROM Orders
SELECT Count(*) OrderDetails FROM OrderDetails
SELECT Count(*> Customers FROM Customers
SET @Today = GetDateO
SET @Count = 1
-- 100000 Orders 10000 Customers.
WHILE @Count <= 100000
BEGIN
- 10 .
IF Count 10 = OR @Count = 1
BEGIN
INSERT INTO Customers

SQL-

239

FullName,
EMailAddress,
Password
)
VALUES

'TestUser_' + Cast(@Count as varchar(10)},


'TestUser_' + Cast(@Count as varchar(10)) + 'test,com'
'password'
SET faCustomerlD = ^Identity
END

-- OrderDate ShipDate.
SET @DateAdd = (-1 * (Count 365))
SET @DateAdd2 = (-1 - (Count X 365)) + 1
INSERT INTO Orders

CustomerlD,
OrderDate,
ShipDate

VALUES
(
CustomerlD,
DateAdd(d, @DateAdd, Today),
DateAddfd, @DateAdd2, Today)
i
SET @OrderID = Identity
SET @SQL = N'INSERT INTO OrderDetails

OrderlD,
ProductlO,
Quantity,
UnitCost
SELECT TOP 10

OrderlD, ProductID, 1, UnitCost


FROM Products '

- 4 .
IF Count I 4 = 1

240

8
SET @SQL = @SQL + N'ORDER BY CategorylO

IF Count % 4 = 2
SET @SQL = SQL + N'ORDER BY ModelNumber'
IF Count JS 4 = 3
SET 9SQL = SQL + N'ORDER BY ModelName 1
IF @Count X 4 = 0
SET @SQL = @SQL + N'ORDER BY UnitCosf
EXEC sp_executesql @SQL,
@OrderID = @OrderID

N ' e O r d e r l D int',

SET @Count = Count + 1

END
-
SELECT CountC*)
SELECT Count(*)
SELECT Count(*}

.
Orders FROM Orders
OrderDetails FROM OrderDetails
Customers FROM Customers


ProductsMostPopular ,
. Query Analyzer Show Execution Plan ( CTRL+K).
ProductsMostPopular . 8-1.
ProductsMostPopular :
CREATE Procedure ProductsMostPopular
AS
SELECT TOP 5

OrderDetails.ProductID,
SUMfQrderDetails.Quantity) as TotalNum,
Products.ModelName
FROM
OrderDetails INNER JOIN Products ON OrderDetails.ProductID =

SQL-

241

Products.ProductID
GROUP BY
OrderDetails.Product ID,
Products.ModelName
ORDER BY
TotalNurn DESC

GO

. 8-1.
ProductsM ostPopular
,
SQL-, ,
. SQL
Server Books Online, , , ,
.
,
.

. , . 8-1
Hash Match/Aggregate Table Scan: 54 46%

242

. , . . 8-2 Table Scan.

able Stan
Scanrcwsl'craliibte.
Table Scan
Table Scan
1,013,819
27

PtiYiicd operation:
Logkil opcnUon
Row count:
Mimalcd row it:

I/O out:

1.12

CPU tosb
humba of f iff tut ft1.
Cost:
Subtree oat:
Estimated raw coin):
Argument:
OBJECT Distort], [do]. [OrdHDeti

0.557
L

3.96
1,013,819

>D

j f ttatan an

. 8-2.

Table Scan

, [store].[dboUOrderDetails] Table Scan. Table Scan


Index Scan Index
Seek.
OrderDetails. Table Scan Index Scan
.
. ,
.

SQL-

243

.
. PRB:
Poor Performance on a Heap (Q297861)
http://support. microsoft. com/default.aspx?scid = kb;enus;Q297861.

SQL Server , ,
STATISTICS . , . ,
.
STATISTICS TIME.
, .
SQL Profiler; ,
STATISTICS TIME , .
, DBCC,
: DBCC DROPCLEANBUFFERS

SQL Server, , a DBCC FREEPROCCACHE .

DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE .

244

,
ProductsMosfPopular Query
Analyzer :
DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE
SET STATISTICS 10 ON
SET STATISTICS TIME ON
GO

EXEC ProductsMostPopular
, DBCC STATISTICS,
. ProductsMostPopular
:
SQL Server parse and compile time:
CPU time = 32 ms, elapsed time = 187 ms.
(5 row(s) affected)
Table 'Products'. Scan count 5, logical reads 10,
physical reads 4, read-ahead reads 0.
Table 'OrderDetails'. Scan count 1, logical reads 3800,
physical reads 0, read-ahead reads 3801.
SQL Server Execution Times:
CPU time = 1813 ms, elapsed time = 1826 ms,
( )
, SQL Server
. ,
ProductsMostPopular 187 ,
1826 . STATISTICS TIME.
, logical reads OrderDetails. , ; 3800

SQL-

245

Products ,
Table Scan . scan count.
(join). , scan count
, (loop join)
100 , 100,
, (merge
join), scan count 1,
, . physical reads read-ahead reads ,
.

.
,
, . , , , . , .
.

SQL Server, , , .
.
SQL Server . . 8-2
.
, 8-2. SQL Server

. . ,

. . .

246

. 8-2.

()

,
. ,
,
(Bookmark Lookup) , ,


-
.
,
, . ,
SELECT
, INSERT, DELETE
UPDATE .
.
, . , , , .
, 3,
.
.
- . , .
.

, .

SQL-

247

, .
,
, . , ,
,
.
.
, (covering) , .
, ,
. , ,
.
,
, , .
, (Searchable
Arguments, 5ARG) ,
.
: 1
ProductsMostPopular , OrderDetails. ,
:

sp.helpindex OrderDetails
OrderlD
ProductlD. , index_description ,
.
, ProductsMostPopular, . 8-3, , .

248

. 8-3.
OrderDetails

(SARG)
GROUP BY ORDER BY
JOIN
,
,

Product! D
ProductID
Sum(Quantity)

,
no (OrderfD, ProductID)


SQL Customize, Tools.
,;
. , . 8-3, $p_heipindexc CTRL-f Ft.

. 8-3. Customize

SQL-

249

spj)eipsndexf
> CTRL + F1. spjiefpindex s
. 8-3, ductlD Quantity . ,
ProductID CROUP BY, ,
ProductID , , , Quantity.
,
.
:
CREATE INDEX IX_OrderDetallsJroductID_Quantity
ON OrderDetails (ProductID, Quantity)
CREATE INDEX IX_OrderDetailsJ3uantity_ProductID
ON OrderDetails (Quantity, ProductID)
, ProductsMostPopular,
ProductID Quantity. :
1 - Pentium.
. 8-4.
Table Scan Index Scan, a
Hash Match/Aggregate Stream Aggregate.
,
:
SELECT TOP 5

OrderDetails. ProductID,
SUM(OrderDetails. Quantity) as TotalNum,
Products. ModelName

FROM

OrderDetails UNDEX=IX_QrderDetails_Quantity_ProductID)
INNER JOIN Products ON OrderDetails. ProductlD = _
Products. ProductID

SROUP BY

250
OrderDetails.ProductlD,
Products.ModelName
ORDER BY

TotalNum DESC

Hrgumtnl:
r([store].[dha] fOrdrOatails]. [ [C_OrderL
:ails ProductlD.'."vI. ITEMED - '-'.VASD

. 8-4.
OrderDetails

.
, .
. . 8-4.
, ProductlD Quantity . -

SQL-

251

, . , .

.
. 8-4.


ProductID

Quantity



no OrclerDetails


Quantity
ProductID

3800

Index Scan (51 %) Index Scan


Stream
Hash (38 %)
Aggregate (49 %) Match/Aggregate (61 %)
2184
2370

1826

1021

Table Scan (46 %)


Hash Match/
Aggregate (54 %)

2095


800 .
, ,
.
,
.
: 2
Ordersiist.
CustomerlD . :
DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE
GO

SET STATISTICS 10 ON
SET STATISTICS TIME ON
GO

EXEC OrdersList @CustomerID = 10704

252

, 1, , STATISTICS STATISTICS TIME, . STATISTICS TIME , 640 . ProductsMostPopuiar;


, Table Scan Bookmark Lookup, . , OrdersList
. , OrdersList.
helptext OrdersList
;
CREATE Procedure OrdersList
(

CustomerID

int

'
As
SELECT

Orders.OrderlD,
Cast(sum(orderdetails.quantity*orderdetails,unitcost)
as money) as OrderTotal,
Orders.OrderDate,
Orders.ShipDate

FROM

Orders
INNER JOIN OrderDetails ON Orders.OrderlD =
OrderDetails.OrderlD

GROUP BY
CustomerlD,
Orders.OrderlD,
Orders.OrderDate,
Orders.ShipDate
HAVING
Orders.CustomerlD = ^CustomerlD
OrdersList , , 8-5:

SQL-

253

. 8-5. Orders OrdersList


Orders

(SARC)
GROUP BY ORDER BY

CustomerlD
CustomerlD, OrderlD,
OrderDate, ShipDate
OrderlD

JOIN
, ,

. 8-6. OrderDetails
Orders List
Orders Details

(SARG)
GROUP BY ORDER BY
JOIN
, ,

OrderlD
SUM(Quantity*Unitcost)
,
(OrderlD, ProductID)

,
,
.
. 8-5 8-6 ;
CREATE INDEX IX_Orders_CustomerID_Covered
ON OrderDetails (CustomerlD,OrderlD, OrderDate, ShipDate)
CREATE INDEX IX_OrderDetails_OrderID_Quantity_UnitCost
ON OrderDetails (OrderlD, Quantity, Unitcost)
, , . 8-7.
. 8-7, . , -

254

. ,
, .
,

.
. 8-7.

Table Scan no
Index Seek no

Orders (22 %)
Orders (42 %)
Bookmark Lookup no Index Seek no
OrderDetails (75 %)
OrderDetails (51 %)

Orders = 520
Orders = 3

OrderDetails - 160
OrderDetails = 30

644


, .

. ,
.
, . ,
. ,
-.
SQL Server .
. . , , , :

SQL-

255

FILLFACTOR;

,
.
FILLFACTOR
FILLFACTOR , . , 80 20% , 1,6 .

.
, ,
(page split), . , ,
' ,
. ,
, ,
.
, , . -
50%,

- 100-
.
, .
FILLFACTOR
,
, .
DBCC SHOWCONTIC
. ,
Orders -
IBuySpy. ,
NULL, OrderlD:
ALTER TABLE Orders
ADD OrderDesc Varchar(SOO) NULL

256

CREATE CLUSTERED INDEX IXC_Orders_OrderID


ON Orders (OrderlD)
GO

8-4, :
8-4
- .
-- .
DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE
GO

- - .
SET STATISTICS 10 ON
SET STATISTICS TIME ON
GO
- Orders.
SELECT TOP 10 WITH TIES CustomerlD, _
MAX(DateDiff(hh, OrderDate, ShipDate)} MaxShippingDelay
FROM Orders (INDEX=IXC_Orders_OrderID)
GROUP BY CustomerlD
ORDER BY MaxShippingDelay DESC, CustomerlD
GO
- Orders.
DBCC SHOWCONTIG('Orders')
GO

8-4:
DBCC SHOWCONTI6 scanning 'Orders' table...
Table: 'Orders' (2025058250); index ID: 1, database ID: 7
TABLE level scan performed.
- Pages Scanned
: 418
- Extents Scanned
: 54
- Extent Switches
; 53
- Avg. Pages per Extent
; 7.7
- Scan Density [Best Count:Actual Count]
; 98.15* [53:54]
- Logical Scan Fragmentation
: 0.24Sf
- Extent Scan Fragmentation
: 1.85*
- Avg. Bytes Free per Page
: 25.2
- Avg, Page Density (full)
: 99.69X
DBCC execution completed. If DBCC printed error messages,
contact your system administrator.

SQL-

257

Table ' O r d e r s ' . Scan count 1, logical reads 419,


physical reads 0, read-ahead reads 0.
1

SQL Server Execution Times .


CPU time = 297 ms, elapsed time = 302 ms.
( )

DBCC SHOWCONTIC Scan Density ( ) Avg.


Page Density ( ). :
, .
.
100%,
- . SQL Server
; ,
8- .
. , , OrderDesc
Orders.
:
- REPLICATE ,
-- .
UPDATE Orders
SET OrderDesc = 'Some description ' + REPLICATE('X',
OrderlD X 10)
WHERE OrderlD X 10 = 0

8-4 Orders. :
Table: 'Orders' (2025056250); index ID: 1, database ID: 7
TABLE level scan performed.
- Pages Scanned
: 834
- Extents Scanned
: 110
- Extent Switches
: 833
- Avg. Pages per Extent
: 7.6
- Scan Density [Best Count:Actual Count]
: 12.59* [105:834]

258

- Logical Scan Fragmentation


: 50.00%
- Extent Scan Fragmentation
: 36.36*
- Avg. Bytes Free per Page
: 3768.9
- Avg. Page Density (full)
: 53.44*
DBCC execution completed. If DBCC printed error messages, _
contact your system administrator.
Table ' O r d e r s ' . Scan count 1, logical reads 836, _
physical reads 0, read-ahead reads 0.
SQL Server Execution Times:
CPU time = 307 ms, elapsed time = 307 ms.
(Result abbreviated)
, ;
: 836
419.
, 99% 53%. . .
, FILLFACTOR
Orders 90%. FILLFACTOR.
,
FILLFACTOR 90, FILLFACTOR DBCC REINDEX, . DBCC DBREINDEX
CREATE INDEX SQL Books Online.


SQL Server 2000 Enterprise Edition. SQL
Server . ,
- . , , -

SQL-

259

.
.
,

, SUM COUNT. ,
SUM ProductsMostPopular IBuySpy.
:
SELECT TOP 5
QrderDetails.ProductID,
SUMCOrderDetails.Quantity) as TotalNum,
Products.ModelName
FROM
OrderDetails
INNER JOIN Products ON OrderDetails.ProductID = _
Products.ProductID
GROUP BY
OrderDetails.ProductID,
Products.ModelName
ORDER BY
TotalNum DESC
, ProductsMostPopular,
,
8-5.
8-5
- ,
- .
SET QUQTED_IDENTIFIER ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI.PADDING ON
SET ANSI.WARNINGS ON
SET NUMERIC_ROIINDABORT OFF

GO

260

if exists (select * from dbo.sysobjects


T
where id = object_id(N [dbo].[ProductQrderCount]') and _
OBJECTPROPERTY(id, N'lsVieW) = 1)
drop view [dbo].[ProductOrderCount]
GO
CREATE VIEW dbo.ProductOrderCount
WITH SCHEMABINDING
AS

SELECT od.productid, p.modelname, SUM(od.Quantity) OrderSum


, COUNT_BIG(O RecordCount
-- COUNT_BIG
FROM dbo.orderdetails od
INNER JOIN dbo.products p
ON od.productid = p.productid
GROUP BY od.productid, p.modelname

GO
-
- .
CREATE UNIQUE CLUSTERED INDEX IXUC_ProductOrderCount
ON dbo.ProductOrderCount (ProductID)
. . 8-5. ,
SCHEMABINDING. ,
.
, , . .
SQL Server Books Online. ProductsMostPopular , . . 8-8,
, ProductOrderCount .
OrderDetails, ProductOrderCount. STATISTICS IO, ductsMostPopular.

SQL-

261

(5 row(s) affected)
Table 'ProductOrderCount'. Scan count 1, logical reads 2,
physical reads 0, read-ahead reads 0.
( )
. 8-8.


Product! D

Quantity

Table Scan (46 %)


u Hash Match/
Aggregate (54 %)

(51 %) u Stream Scan (77 %}


Aggregate
(49 %)

u Sort (23 %)



OrderDetails

3800

2184

1826

1021

20

Index Scan

Clustered Index

ProductsMostPopular
, , , . .
,
,
. ,
, ,
.
SQL Server Index Tuning,
. Index Tuning ProductsMostPopular.

262

Query Analyzer ( CTRL-f-l). ProductsMostPopular .


Index Tuning .
, SQL Server
Books Online. , , Microsoft TechNet.
, ,

.


. ,
, ,
. . SQL

.


SQL-.
,
. , SQL Server , , , , >>
SQL-.

, ,
: .
? , Web -
,
. Microsoft Transaction Cost Analysis (TCA) , Web- . , Web. .

, . ,
, , . -

264

. . . ,
, Web- Web- Microsoft 1998
1999 . Microsoft,
- (Hilal Al-Hilali), (Morgan Oslake),
{David Cuimbellot), (Perry Clarke) (David Howell). , .NET,
-, . -,
, Web-
, , ,
,
. , Web-,
, , 10 000 ? , . , , ,
, .
Web-
Microsoft, http://shop.microsoft.com.
, .
, Web-. -

US-

265

,
, , , .

:

?

. ,
. , .
HTTP- . , . ,

Current Anonymous Users. , ,
, , , .
, Web- IBuySpy,
.NET. , Web-. (think
time), . . , ,
, ,
, IBuySpy,
,
.


,
, . -

266


, ,
, Web-. , so ,
, Web-
,
.
, 50 ,
. , , .
, ,

. 50
, . , , , ,
. ,
.


,
,
.
,
Web-.
, .
,
,

IIS-

267


, ,
: ?
.
,
,
Web- .NET Windows DNA.
. Windows DNA .NET Web-. . 9-1
. , , ,
, Windows DNA .NET.
9-1.
Windows DNA .NET

Windows DNA

.NET

ASP Requests/Sec
( )

Active Server Pages


( Active Server)

ASP,NET
Applications

ASP Execution Time


Active Server Pages
( ) ( Active Server)

ASP.NET

ASP Wait Time


( )

Active Server Pages


( Active Server)

ASP.NET

Requests Queued
( )

Active Server Pages


( Active Server)

ASP.NET

, ,
.

268


,

.
, , . ,
. ,

Microsoft shop.microsoft.com.

Shop.Microsoft.com
- 1999. Team - Microsoft http://shop.microsoft.com 2.5. , /
, ',,.
= (CPU), , ,
- , .
;

,. - ;
http://shop.rnicrosoft.com 4.5,
, 25% ,
;;
. ,
25% /;
, -

US-

269

cuu 4.5. '-, - ?


, \ , - ::
V 2.5. 4.5
, , 5
npocosASf .'
!
,.
,
!
== 2.5 <, "
,

. : Web-
;:
- ,
. , , -
, ,


. Web-. ? ,
,
.
,
.

, ,
.
. Microsoft Excel,
. , . -

270


.
.
-
, . . 9-1 .
1. .


.

2.
.



ASP
.
3.
.

,
1 2.

4. .


.
5. .

.
.

. 9-1.

1:
.
Web ( ) -

US-

271

.
, , ,
.
. Web- IBuySpy 61% .

IIS. IIS,
. .
( ,
IIS ) , , .
, .

,
. ,
, 200,
,
.
, , Web
, IIS (, ).
Web-. ,
.

10-566'

272

, , .
,
, , , ,
. , IIS ,
60%
10%. ,
95%
40%
80% .
. 9-2 ,
IBuySpy TCA.
. 9-2. IBuySpy TCA

(
), %

, %

14,14

61,49
10,47

0 5

6,90

0,5

1,5

, ,
.

IBuySpy, Web-
shop.microsoft.com.
, .

US-

273

, ,

IBuySpy 10 . . ( 5),
, .

2:

, .
.
, ,

. Microsoft ACT,
/ , 3.
. ACT, , -, .

IIS , ASP- . ASP
ASP-
. , .
ASP 2 . :
ASP = (.
ASP * . ASP)

274

.
(steady-state^. , ,
,
. IBuySpy 10 , . , ASP- , .
ASP-
, , / ,
. ,
IBuySpy ,
,
15 000.
, - , , , . ,
15 000 . ASP- , .
,
.

4.


, , , .
IBuySpy . -

US-

275


, ASP . Windows DNA
.NET . . 9-1. , , ASP- . , ASP ,

Web-, ASP . ,
ASP- , ,
.
, ,
, ASP- . , ASP- . 1, , . .
ASP- ,
100%,
ASP-
. 100%,
. IBuySpy
90%.
,

,
.

276

(Add to Cart), ,
,
, (Browse], (Add to Cart].

. ,
, . ,

, ,
.

3:

, 2,
,
. IIS IBuySpy
1000 .
, ASP- . { ASP + ASP) 2 ,
ASP 1,
15 000 90%. ,
,
ASP- , .9-3.
, , ASP . . 9-4.

277

HS-
. 9-3.
IBuySpy


, , /

ASP,
62

56

118

1012

3,8

1015,8

8188
4415

350

355

3262

12,5

0,88

13,38

5287

600

130

730

8355

. 9-4. IBuySpy

ASP-
, %

ASP-/

()

()

58,20

193,3

1164

6,02172

',',]

89,5

349,8
98,3

1680
1790

4,80722
18,20956

76,2

307,3

1524

4,95932

89

279,9

1780

6,35941


(
. 9-4), 1 . -

278

genuu IBuySpy
1000 2000 . ASP 8 , :
= *
* ( ) /
ASP
, IBuySpy, 349,8 ASP- 84%. ASP- 84% * 2 * 1000 / 349,8 = 4,80274
. ,
ASP-,
. ASP- ( , , ,
. .).
, ASP-.

ASP-, ,
,
,
. .

Web- . Web . , 1,
Web-.
,
,
, . ,
,
. . -

US-

279

, 10 ,
. ,
( 1000 1000 ). IBuySpy

. 9-5.

.9-5 /;
(0,11601 ),
. ,
.
4 . . 9-5 ,
, . , : 0,03394 0,03385 .
(8,21 ). ,

,
, ,
ASP- (
13). , [6,36 } , . , .
,
, ,

. 9-5. . IBuySpy ()

( ), %

.
Asp

61,49

0,61

2,18919

0,00365

4,80

0,01752

14,14

0,28

1,00684

0,00168

6,02

0,01010

10,47

0,31

1,11827

0,00186

18,21

0,03394

6,9

13

0,90

3,19353

0,00532

6,36

0,03385

10

0,70

2,49217

0,00415

4,96

0,02060

100

2,81

10,00

0,1 1 601

US-

281

- ,
,
, .
,
, , , .
1 , 1,5%. , , 2
, , 10,47% + (2*1,5%) = 13,47% Web-. ,
, , ,
, , , , , . ,
3%
.

. 9-6:
. 9-6, 0,11601 0,12227 . , ,
4,

4:
4 ( )
.
, . 9-7. -

. 9-6. . ( ) IBuySpy

( ), %

.
ASP

(
)

/
/

58,49

0,58

2,03883

0,00340

4,80

0,01632

14,14

0,28

1,00684

0,00168

6,02

0,0101

13,47

0,31

1,40860

0, 00235

18,21

0,03394

6,9

13

0,9

3,19353

0,00532

6,36

0,03385

10

0,7

2,49217

0,0041 5

4,96

0,02060

100

2,81

10

0,12227

?
fa

QJ

US-

283

, 3,
Web-.



(, ). . , 2, ,
100%.
IIS 85%. 2 000 * 83% = 1 700
. . 9-7 IIS 1000 .
. 9-7 ,
IIS IBuySpy 14 654 1700,01 . ,
2
85% 1700 . .
. 9-7. IBuySpy

14 300
400
14 500
14 600
14 654

1658,94
1670,54
1682,15
1693,75
1700,01 (
)
1705,35
1716,95

14 700
14 800

284

,

3 , 2
.
0,11601 0,12227 . , 3%, ? . 9-8 .
. 9-8. IbuySpy

13 500

1650,65

13 600

1662,87

13 700

1675,10

13 800

1687,33

13 903

1700,04 (
)

14 000

1711,78

14 100

1724,01

, 2
3% IIS 14,654 13,903.

,

.
, . ,
, . , , ,

US-

285

, G
.

5:
, .
,
, .
. . .
-,

.
, , .
IBuySpy,
. IBuySpy
, 2.
. , 10 , 10- . , 10
IBuySpy, , . 3
. . 9-2
IBuySpy.
,
, 10%. , ASP- 2 .

286

. 9-9 , 10%.
ASP-, 2 . . 9-9, ASP- ,
.

2000

1000

100

200
1000
10000
14653
IBuySpy

"]

. 9-2.
. 9-9. IBuySpy

ASP,

ASP,

ASP,

100
200

11,60
23,2

11,54
23,8

0,238
0,769

1000
10000
14653

116,01
1160
1699

120,19
1147
1661

4,301
5,863
7,99

27,203
39,98

4,063
5,094
6,09
52,441
72,47

79,644
111,45

, , , ,
.

IIS-

287

,
. ,
,
. ,
. Web-. :
1. ;
2. ;
3. ;
4.
Web- ;
5. .
, Web-
, , , .

10

(Transaction Cost Analysis, TCA) : ,


. ,

.
, ,
,
, ,
, , : . , , . , ,
, , , , . ,
. ,

: 289
, .
, .
,
. , - .
, , ,
. -,
,
.




. ,
Excel. -
, ,
, 9 Shop.Microsoft.com, . , , . .
,

290

10

, , , ,
, .
, Web-?
. , ,
, . , , ,
.

.
. ,
, , . .
, .
,
, , .

. ,
Universal Modeling Language (UML) .

291

.
.
, , ; ,
.


, , . :
, ;
,
;
, ;
, , Indy Microsoft.



? , - .

,
, , . -

292

10

,
. , , , , - ,
. ,
, , .
, , ,

. ,


, .

, ,
, .
. , , ,
.


,
. , , , -
,
.

: 293



. ,
. , .
, ,
,
. , ,
.

, , .

. , , :
.


,
: , . ,
.


,
. , .
, , ,
-

294

10

, . ,
, .
, Web-, HTML-,

(, ), ( HTML,
Web-), ( ,
) (

). ,
, .
{ ) , , .
. (
, ,

), .
, , . ,
, ,
, .

: 295

.
, .
,
.

.
, , ,
.

,
: ,
.
,
. ,
, , .
, . , -,
,
, ,
.
( , ).
,
. , -

296

10

, . , , ,
.
.

. , . ,
,
. , ACT.

, .
, IP-.
100-
, 20 . ,
, , , . , ,
,
.
,
, .

297

, ,
, . ,
.

,
(, UML) .
,
, ,
.

V . . , , , Indy, , ,
.


, . , , .
, ,
.

298

10


, ,
.
, ,

.
,

.

Indy:

, ( )
, Indy. Indy Microsoft
.
,
,
. . ( ) .

. , :
, .

Indy
Indy
, -

: 299
.
. .
Indy
. . , Indy , , , .
, .

, .
, ( ). , Indy
,
.
, , ,
,
. Indy , XML, Transaction
Modeling Language (TML). TML ,
Web-,
(, ,
) .

Indy
.10-1 Indy .

Indy , API. , Indy, . -

10

300

, . , Indy ,
.
, , , .
(DLL)

(DLL)

. 10-1. Indy

, , .
,
. , ,
.
;
, .

301

, .


.
,
. , TML . UML .


. , , .
, ,
, , TML.

,
, .
Excel SQL. IndyView.
, Indy. .

IndyView
IndyView,
Web IBuySpy. XML-,
.

302

10


Web- IBuySpy, .10-2.

IIS

SQL

. 10-2. Web-
IBuySpy
IIS SQL ( Web- IBuySpy),
. IIS .
.10-3 ,
Web- IBuySpy IndyView.
, IIS (iissrv) , . ,
. SQL (sqlsrv) ,
. , -

: 303
115 ,
, .

. 10-3.

Indy Web- IBuySpy

sqlsrv, CPU x 2,
: CpuModel:Pentium 1000, , . , Disk x 1 DiskModel: HP NetRAID-4M,
.
. , ;
.
net Ian, , , -

304

10

.
, , ,
. .
XML- .10-3:
<?xml version="1." encoding="utf-8"?>
<system name="IBuySpy">
<active_device type="computer" name="iissrv" count="1">
<active_device type="generic" name="lan_nic_send"
count="1"/>
<active_device type="generic" name="lan_nic_recv"
count="1"/>
<active_device type="generic" name="net_nic_send"
count="1"/>
<active_device type="generic" name="net_nic_recv"
count="1"/>
<active_device type="cpu" name="cpu" count="2">
<rct name="cpu"/>
<use_template name="CpuModel:Pentium 1000MHz"/>
</active_device>
</active_device>
<active_device type="computer" name="sqlsrv" count="1">
<active_device type="generic" name="lan_nic_send"
count="1"/>
<active_device type="generic" name="lan_nic_recv" _
count="1"/>
<active_device type="cpu" name="cpu" count="2">
<rct name="cpu"/>
<use_template name="CpuModel:Pentium 1000MHz"/>
</active_device>
<active_device type="generic" name="disk" count="1">
<rct name="disk"/>
<use_template name="DiskHodel:HP NetRAID-4M"/>
</active_device>
</active_device>
<open_device name="client"/>
<passive_device type="network" name="net" ports="100">
<use_template name="NetHode!2:OptifnumCapacity"/>
</passive_device>
<passive_device type="network" name="lan" ports="100">

: 305
<use_template naroe="LanModel :Ethernet"/>
</passive_device>
<link active="client" passive="net" fromport="0" toport="0"/>
<link active="iissrv[?].2" passive=" net" fromport="0" toport="99"/>
<link active="iissrv[?].3" passive=" net" fromport="0" toport="99"/>
<link active="iissrv[?].0" passive=" Ian" fromport="0" toport="99"/>
<link active="iissrv[?].1" passive= Ian" fromport="0" toport="99"/>
<link active="sqlsrv[?].0" passive= Ian" fromport="0" toport="99"/>
<link active="sqlsn/[?],1" passive= Ian" fromport="0" toport="99"/>
</system>
, TML-, .

.
,
.
IBuySpy
, . ,
TML IBuySpy;
<tml>

<!- BasicSearch
aspx- gif-

->

<transaction name="BasicSearch" frequency="BasicSearchFreq">


<include name="ChooseClientSpeed" />
<action name="net_msg_sync_async" connection="net"
service="Client" saveschedule="clientstate">
<param name="linkspeed"
value="transaction.ClientSpeed" />
<param name="msgsize" value="HttpRequestSize*3" />
<peer name="target" service="IIS"
saveschedule="iisstate" />
</action>
<action name="compute" service="IIS" useserver="iisstate">
<param name="cpuops" value="BasicSearchCpu" />
</action>

306

10
<action name="net_msg_async_sync" connection="net"
service="IIS" useserver="iisstate">
<param name="linkspeed"
value="transaction.ClientSpeed" />
<param name="msgsize" value="BasicSearchSize" />
<!-- aspx ->
<peer name="target" service="Client"
useserver="clientstate" />
</action>
<fork>
<branch>
<action name="net_msg_sync_async" connection="net"
service="Client" saveschedule="clientstate">
<param name="linkspeed"
value="transaction.ClientSpeed" />
<param name="msgsize" value="HttpRequestSize" />
<peer name="target" service="IIS"
saveschedule="iisstate" />
</action>
<action name="net_msg_async_sync" connection="net"
service="IIS" useserver="iisstate">
<param name="linkspeed"
value="transaction.ClientSpeed" />
<param name="msgsize" value="0.04" /> <!- 1x1.gif ->
<peer name="target" service="Client"
useserver="clientstate" />
</action>
</branch>
<branch>
<action name="net_msg_sync_async" connection="net"
service="Client" saveschedule="clientstate">
<param name="linkspeed"
value="transaction.ClientSpeed" />
<param name="msgsize" value="HttpRequestSize" />
<peer name="target" service="IIS"
saveschedule="iisstate" />
</action>
<action name="net_msg_async_sync" connection="net"
service="IIS" useserver="iisstate">
<param name="linkspeed"
value="transaction.ClientSpeed" />
<param name="msgsize" value="1,52" /> <!- thumbs/
image.gif ->
<peer name="target" service="Client"
useserver="clientstate" />
</action>
</branch>

307

</fork>
</transaction>


.
, .
, (
action /action) .
1. net_msg_sync_async: HTTP-
( ) IIS ,
. (. .
), (
}.
2. compute: HTTP- IIS,
,
3. net_msg_async_sync:
IIS , .
, , BasicSearchSize ASPX, , BasicSearchSize
,
ASPX-. IndyView.
4. ,
.
, net_msg_sync_async
net_msg_async_sync,
GIF- ( 1x1.gif)
0,04 .
, net_msg_sync_async
net_msg_async_sync,

10

308

GIF- ( thumbs/image.gif)
1,52.
, . , , , , ,
ASPX- .
, ,

:
<service name="IIS">
<serverlist>
<server name="iissrv" />
</serverlist>
<actionscheduling>

<schedule action="compute" policy="roundrobin">


<target device="cpu" />
</schedule>
<schedule action="net_msg_async_sync" connection="net"
policy="random">
<target device="nic_send" />
</schedule>
</actionscheduling>
</service>
, IIS
iissrv ( ). iissrv
. ,
, , . (
) , .
API Indy,
, IndyView

,
. .10-4,

: 309
10-5, 10-6 10-7
Web- IBuySpy.

. 10-4.
TML
IndyView , .10-4. TML; .

.
; Web-, Web-, Web- . , , . . 10-4
( ),
iissrv ( }.

310

,,

.-^-^.

*---

ft

tl9>nifOOIIO].Nt4
llt*IVfiV>ll|>|.l>ro5

a
il| . |"l 1-

vlattite 0136

2s

mo

136

11*

ins

iisg

)iss

mi

6(

11II

117S

>

. 10-5. -
.10-5 , , .

. , ( }, . , ,
, .
, . , . , .
.
IIS (iissrv[0000].0004-0005) SQL
(sqlsrvf0000].0004).

: 311
,
, Transaction
Analysis IndyVievv, ,
(.10-6).

. 10-6.
,
, .

, .
, , . , , , : HssrvfOOOOJ.0002,
, IIS ; Hssrv[00001.0003,

312

10

;
iissrvf0000].0004, .
. , IndyView

. .10-7 ,
, Windows.
SQL { ) (, , 5%}.

4.

. 10-7.
IndyView , , Excel.

: 313
.10-8 IBuySpy .
IIS,
SQL. , IIS,
21,4. :
. SQL
.

.10-8.

,
.
US ,
.
, , IIS -

314

10

, .

9 , .
Indy, IBuySpy , , ,
, . 10-1 .
. 10-1. Indy


Indy

1000

115,8

120,2

10000

116,0
1160,0

1166,0

1147,0

14653

1699,0

1694,0

1661,0

Indy
, , , ,
Indy, .
, Indy .

, Indy
,
- , . ,
, -
Indy.

315

, 1:
.10-9
Indy. Web-.
, . , Web-
. Web Web-
.
Indy
, ,
SQL .
,
, SQL
.
6000

-- 35
- HS
SQL
--- /

-- |
>ij
- 25
*
t,

.
20 ,s

' = 1_
10

5
6
7

. 10-9.
,
SQL
, SQL , , .

10

, 2:
Indy . ,
IBuySpy -
Web- 450 . , , Indy
,
46,8 . ( ), . Web- 1 . ,
Web-, Indy :
,
53,5 . ,
,
, .
,
, Indy :
73,4
. ,
, .

Indy . ,
, Indy
. TML , , Indy
.
, -

317

, . , ,
, , , .

.NET managed code .


.NET

A
ACE 205
ACT (Application Center Test) 1 5,
32, 33, 148, 231
Developer Edition 64
- SBC 36
39, 40
36
36
39
45
36
62
48
38, 43

45
46
34
39
ACT Team 93,98
Active Directory 146
ADO (ActiveX Data Objects) 57
ADO.NET 5,171
alert .
ANSI 189
API 72, 169
AppDomain .
Application Center 2000 5
Application Expert 116, 118, 130,
131, 136

133
132

131, 136
138
134
AppMetrics (AppMetrics for
Transactions) 211
AppMetrics Manager 211
ASCII 149
ASCX 144
ASMX 144
ASP 3, 7, 142, 143, 167, 187
ASP.NET 5, 43, 142, 143, 144, 146,
166, 206
167
167
169

163
157,1 58
ASPX 144,159
assembly .

backend activity profile . ,



bandwidth .
batch .
BizTalk Server 2000 5

186,206

- + 206

C++ .NET 186


128
CAS (Code Access Security) 204
CLR [common language runtime) 5,
185, 188, 190
COM 36,189
COM+ 211
Commerce Server 2000 5


Compuware Application Expert 109
cookie 38
cross-application calls ,

CS 144
CSS 113

D
DCOM 209
DevPartner Studio 205
Diagnostics Monitor 213
DLL 143,189
DNA 267
DNS 68
121
121
DPC (deferred procedure call) 88
DSL 21
Enterprise Manager 235
Enterprise Services 5,211,215
Exchange Server 2000 5
Extensible Markup Language CM. XML
FILLFACTOR 255
GIF (Graphics Interchange Format!
115
Clobal.asax 144

H
Host Integration Server 2000 5
HTM 113
HTML 7, 113, 142
HTTP (Hypertext Transfer Protocol)
7, 9, 38, 113, 155, 161, 166, 209
hub .
I
IIS (Internet Information Server) 24,
113, 123, 126, 142, 143, 148, 149,
154, 206

319
Index Tuning 261
Indy 298 "
300

301
301

301
299
Indy View 301
INIM (Internet Native Integration
Methodology) 8
Instrumentation Manager 206
Internet Security and Acceleration
Server 5
IP- 121,151
JIT (lust-in-Time Compiler) 186, 187
JS 113
IScript 36, 117, 206

M
MAC-agpec 121, 129
machine.config 146
Microsoft .NET 4
Microsoft .NET Framework 3, 5
Microsoft .NET Passport 9, 10, 41
Microsoft US Log Format 149
Microsoft Internet Explorer 11 3
Microsoft Passport 39, 41
Microsoft SQL Server 1 23, 1 71
MMC (Microsoft Management
Console) 70
Mobile Information Server 2001 j
Mobile Internet Toolkit 5
MSIL (Microsoft Intermediate
Language] 186, 188
N
NCSA Common Log File Format 149
Network Monitor 109, 110, 116,
120, 121
1 22
122

320
129
129
- 122, 123
122
Network Monitor 2 Full 121
Network Monitor 2 Lite 121, 126
ngen.exe 188
NLB (Network Load Balancing) 183
NTLM (NT LAN Manager) 38, 39

ODBC 149
OLE DB .NET Data Provider 1 71
Oracle 171
OSI (Open Systems Interconnection]
108

pathping 110
PDA (Personal Digital Assistant] 1, 6
Performance Logs and Alerts 70, 100
Performance Monitor 26, 70
PERL 36
ping 110
Production Monitor 215, 216

Query Analyzer 262

R
Remote Network Monitor 125
Response Time Predictor 134
Robots Exclusion Standard 44
RPC (Remote Procedure Call) I
RPS (requests per second) 48
SARC (Searchable Argument) 247,
253
SBC (simultaneous browser
connection) 36, 38
SDL (Service Description Language)
SMS (System Management Server)
121
SNMP 217

SOAP (Simple Object Access Protocol)


7, 8, 9, 42
SQL Profiler 26, 118, 138, 221
SQL Query Analyzer 221, 228, 235
SQL Server 2000 5, 96
SQL Server.NET Data Provider 1 71
SSL 41,42,180

TCA (Transaction Cost Analysis) 13,


263, 264, 266, 267, 273, 288, 289
TCP/IP 108
tracert 110
TTLB (Time To Last Byte) 48

UDDI (Universal Description,


Discovery and Integration] 8, 9
UML (Universal Modeling Language)
290
Unicode 189

V
VB 144
VBScript (Visual Basic Script) 36,
11 7, 206
Visual Basic 205
Visual Basic .NET 9, 144, 186, 206
Visual 206
Visual C# 9
Visual C++
9,206
Visual Studio .NET 5, 34, 146
Visual Trace Route 110

w
W3C Extended Log File Format 149,
150, 151
WAN- 139
WAP (Wireless Application
Protocol) 1
Web.config 146, 159
Web- 142
Web- 9
Web- 166
Win32 152

321


Windows DNA (Windows Distributed
interNet applications Architecture)
3
Windows Forms 5
WSDL (Web Services Description
Language) 8

XML (Extensible Markup Language)


5, 1. 8, 9, 42, 144, 146, 177

. SARG
144
Microsoft Passport 39, 41, 144,
145
-Windows 40, 144, 145
39,40, 145
39, 40, 145
145
39, 41
145,146

5
233

187
. TTLB

234
234
234
186
188, 200

3
109

265

124


214
237, 245
245, 254
246
247, 251, 253

298
194, 202
196
196

189, 196, 205


205
205
. JIT
188
125
230
191
191

189

181, 182
181
166, 181
114
301
. INIM
211, 21 3
299
144
72
84

322


. CLR
71
.NET CLR Exceptions 202
NET CLR Loading 200
.NETCLRLocksAndThreads 201
.NET CLR Memory 197
.NET CLR Security 203
193
189, 192
72, 100, 101, 103
. Performance Logs
and Alerts
70
.
DPC

222
.
SBC
112
124
109
119
223
258, 260

23
26
109, 116, 118,
134, 138, 139
123
214
20
86
28
28, 116
68
123



27, 29
162, 215
32,
178
15
66, 273
25
36

26
36
16,21,
32
25
149
1 72
1 73
1 79
209
194
123
27

108
111,112
165

164
11 7
15
13
33
26
28
- 21
1 71
109
. SOAP

. HTTP

323


26
270

24

.
XML

190, 191
186, 201
188
189, 190

229
230
166
109, 110
120
109
124
70, 78, 84, 92,
162, 227
120
222
245
245
245
43, 1 70

255
109
71, 85, 1 62
-#GC Handles 197
- # Gen 0 Collections 198
- # Gen 1 Collections 198
-#Cen 2 Collections 198
- # Link Time Checks 204
# of Exceps Thrown 202
# of Exceps Thrown /sec 203
- # Total Committed Bytes 1 99
-%TimeinCC 199
% Time in RT checks 204

ASP Execution Time 267


ASP Requests/Sec 267
-ASP Wait Time 267
Batch Requests/sec 228
Buffer cache hit ratio 227
Contention Rate/sec 202
Current Queue Length 202
Gen 0 heap size 199
Gen 0 Promoted Bytes/sec 199
Gen 1 heap size 199
Gen 1 Promoted Bytes/sec 200
Gen 2 heap size 200
Lock Requests/sec 227
Lock Timeouts/sec 227
Lock Waits/sec 228
Memory Grants Pending 228
Number of Deadlocks/sec 228
Requests Queued 267
SQL Compilations/sec 228
SQL Re-Corn pi lations/sec 228
-Stack Walk Depth 204
- Total # of Contentions 202
Total AppDomains 200
- Total Assemblies 201
- Total Classes Loaded
201
- Total Runtime Checks 204
User Connections 227
90
104
76
74
86
102

- .NET" 196

ASP.NET 163
-IIS 162
- SQL Server
227
-TCA
267
104

109
41

324
.

117,222
127

*,


. RPC
228
.NET 185

Web- .
VVSDL

. RPS

222


Togg (Todd Kutzke} Microsoft Application
Consulting and Engineering (). Web-,
, - . Microsoft
Deloitte & Touche ABN-AMRO Bank.


(William Eric Morris) Microsoft
Web-.
, .
, Fortune 500 -, , Web-, , Web-,
. ,
. , . eric@07734.org.


(Steve Lee) MCDBA, MCSD, MCSE CCNA
MSN Microsoft.
.

'
' (Brian D'Mello) Microsoft
Team Web-
Microsoft. .
Web- SQL-.


(Khiaw Meng (K.M.) Lee) Microsoft . -. ,
, .

.
, (Nicolaas F. Jansen) Microsoft Team. . .


(John Hopkins) Microsoft Team
.
.

.
, (Irfan A. Chaudhry)
Microsoft Team. . : MCSE
Microsoft SQL Server 2000 Administration, Readiness Review. Exam
70-228 (Microsoft Press, 2001); Microsoft Windows 2000 Performance Tuning Technical Reference (Microsoft Press, 2000) Peter
Norton's Complete Guide to Microsoft Windows 2000 Server (Sams,
2000).

MICROSOFT
. ( ) , ^ (
) Microsoft Corporation ( Microsoft}.)
Microsoft, , ( ). , , , , . , . ,
. ,
, - .

, .
1.

. :
ai . Bui . ,
, .
TJ) .
, ,

, .
.
cj License Pak. Microsoft License Pak,
, ,
, . , , .
tlj . ,
( ),
.
( . Microsoft idllml . uweeie
, .
! . idKiii) Microsoft gaei or
, ( ), Readme, ,
.
liil . Bui , , , : ) ; '> ,
Microsoft ; )
cociae \; ?'( or
Microsoft , ,
;
gj .
Microsoft.

2.


, . , ,
, ( , ) .peujaeicsi , .

"
. .
> .

. . ,
,

. Microsoft ( ) {
( ).
? Microsoft, , / , Microsoft.
, , .
, Microsoft , Microsoft , . , Microsoft .
. , , , ,
( , , , ,
] .
. Microsoft , .
.
1.

. (
, , , , , , , ,
. )
Microsoft . ; . . , , , , , ,
. , , .


11 ( )
- . MICROSOFT
. .
1 .

MICROSOFT. ,
, , , - ( ,
, . , 1 ( ')
. 1- MICROSOFT ,
, .

(), { , ) , .
- , ,
Microsoft no , ,
Microsoft : Microsoft Sales Information Center, One
Microsoft Way. Redmond. WA 98052-6399-

Microsoft Corporation


Web- Microsoft .NET

. .

. .

. .

, .
. .
-
Adobe PageMaker 6.0

. .


121087, , . , .9
.: I.095) 142-0571, ./: (095) 145-4519
e-mait: info@rusedit.ru, http:// www.rusedit.ru


17.02.03 . 3 000 .
60x90/16. . . . 22

107105, , . . , 46


:

'
, 38,
.: (095) 778-7269
- . . 6.
/ (095) 928-3567
. , 8.
.: [095) 290-4507
" .> -, -.
.: (095) 137-6019
. . 8,
.: (095) 238-5001
-
78. .: (095) 152-4511
..
13 .1, .: (095) 150-6917
2- -, 54,
.: (095] 978-5047
, 8.
.: (095) 229-6483

-:
, -., 2
.-(812) 318-6402
. -., 20
.: (812) 312-0563. 314-7184
,
-., 57, .: (812) 273-5053
, .
2, .: (812)16-5-6565, 164-1413
, -., 13.
,: (812) 312-6734
",
.: (812] 247-1483
- ,
.: (812) 567-7025

:
, 12,
.: (3432] 59-4200

:
.
. -, 44,
, 2-

:
000 -Ton-, .: (3832} 36-1026

- ():
,
. .. 8-327-908-28-57, (3272) 76-1404

():
000 -,
.: (+1038044) 269-0423
-
: (+1038044) 268-5346

e d u c a t i o n

!

Microsoft
:
Windows 2000 /
* SunSoiarisS
* Visual Studio .NET
9

Microsoft
Technical Education
Center
SoftUne
119991 . , . , .
.: (095) 232 00 23
e-mail; educ@softline.ru
http://education.softiine.ru

*
40 .

.
.
.


-
-
!
-

- ,

- ,

- CD-

:
Soft - 73140, Hard'n'Son + CD

IIIIIIIIIIIIIIIIIIIIIM
_

-,

Web-,


?
Microsoft
, ,
Web- Web-. ,
Web-
,
,
Microsoft
Internet Information Services, Microsoft ASRNET,
SQL-.



( );


(Transaction Cost Analysis).

:
Microsoft Application
Consulting and Engineering
(ACE) Micro

* , Microsoft.com,
Xbox.com .

i .


Microsoft Application Center Test (ACT).

Microsoft, MSN.con,

-
.

. '

Web-.


-,

* .

, -

Web-.

* SQL-.
*
(Transaction Cost Analysis).

ISBN 5-7502-0224-0

785750 202249

Web- : www.rusedit.ru
-: www.ITbook.ru