AcquireRequestState event, 196
ActionType enum, 181
Add Cache Rule dialog, 99
Address Windowing Extensions (AWE), 260
AddValidationCallback, 110
Add Web Reference dialog, Visual Studio, 174, 175
Adobe Photoshop, 10
AdomdCommand, 357
AdomdConnection, 357
ADOMD.NET
library, 338
Microsoft SQL Server Feature Pack, 355
multiple-row result, GridView, 358–359
reference addition, 356
Advanced Output Cache Rule Settings dialog box IIS Manager, 103
Ajax and plain JavaScript, 9
allowCustomSqlDatabase property, 189, 195
Analysis Services Processing Task, 360
Application policies
batch compilation, 258
Check Page.IsPostBack, 255
Check Response.IsClientConnected, 256
cross–page postback, 256
custom HttpHandlers
aspx page, 236
BeginProcessRequest() method, 236–237
EndProcessRequest() method, 237–238
generic handler, 236
IHttpAsyncHandler, 236
custom HttpModules
applications, 228
async operations, 228
BeginAuthenticateRequest Event Handler, 230–232
database table and stored procedure, 234–235
EndAuthenticateRequest Event Handler, 232–233
EndRequest Event Handler, 233–234
Global.asax file, 227
PreRequestHandlerExecute Event Handler, 230
web.config, registering, 235–236
flush1.aspx, 248
OnPreRender() event handler, 249
Page.CreateHtmlTextWriter(), 250
page refresh identification, 255
Render() method, 248
Response.Flush() method, 248
Task.Factory.FromAsync(), 249
Application thread pool
asynchronous file I/O, 176–178
asynchronous page (see Asynchronous page)
asynchronous web requests, 178–179
asynchronous web services, 174–176
synchronous page (see Synchronous page)
<asp:Label> controls, 357
ASP.NET, 62
application policies (see Application policies)
browser providers
BrowserProvider.cs, 217
HttpBrowserCapabilities, 218
HttpCapabilitiesProviders, 217
Request.Browser.Id, 219
bundling and minification, 212
caching browser-specific pages, 212–213
control adapters
lowercase URL, images, 214–215
development, 407
dynamic JavaScript, 219
HttpModule, 18
image resizing
App_CodeImageResizer.cs, 222
async keyword, 222
async property, 224
bitmap object, 223
FromSync() method, 223
ImageCodecInfo object, 223
JavaScript markup, 220
master pages
<asp:ContentPlaceHolder> tag, 200, 201
<asp:HyperLink>, 201
Auto ID elements, 201
DOCTYPE Strict, 199
dynamic, 202
MasterPageFile, 200
referencing, 202
in visual studio, 201
object caching
CacheItemPriority, 115
file-based dependency, 115
global scope and indefinite lifetime, 113
HttpContext.Items, 113
thread safe, 114
TimeSpan, 115
output caching
disable, 105
outputCache directive, 103
substitution caching, 105
VaryByCustom property, 109
session (see Session state)
software development process
optimization management, 414–415
threads and sessions, 414
themes
add ASP.NET folder, 210
asp:Image> tag, 211
precaching themed images, 211
runtime, 211
skins, 209
static files, 208
themable properties, 210
threads
application thread pool (see Application thread pool)
background worker threads (see Background worker threads)
ReaderWriterLockSlim, 185
user controls (see User controls)
ASPState database, 188, 189, 195, 196
Asynchronous page
async task execution
after PreRender event, 171
asynchronous programming model, 165–166
vs. synchronous load tests
configuration file, 167
IIS application thread pool, 169–170
test script, 167
WCAT tool, 167
task–based asynchronous pattern, 166–167
Asynchronous programming model (APM), 165–166, 278
Async point, 163
AsyncTimeout property, 173
Attributes panel, 347
Background worker threads
BeginInvoke() method, 179
Dispose() methods, 180
lock statement, 180
logging
Enqueue() method, 182
QueuePageView() method, 182–183, 185
ThreadAbortException, 185
WorkItem class, 181
task serialization, 185
ThreadPool.QueueUserWorkItem() method, 179
Base-64 encode, 84
BeginAsyncHandler method, 185
BeginAsync() method, 165
BeginExecuteNonQuery() method, 165
BeginInvoke() method, 179
Beta-test phase, 402
BinaryFormatter, 197
64-bit memory systems, 260
Bring online immediately option, 366
Browser cache
dynamic content, 66
disable, 67
profiles, 66
VaryByParam, 66
static content, 63
conditional GETs, 63
disable browser caching, 65
Bug bar, 403
Bug tracking, 403
Business intelligence (BI), 337
CacheDependency object, 116
CacheItemPriority, 115
Cache object, 412
Cache.SetVaryByCustom() method, 412
Cache validation callback, 412
Caching
browser cache (see Browser cache)
configure, 63
cookies (see Cookies)
definition, 61
expiration times
dynamic content, 120
flush mechanism, 120
static content, 120
proxy cache (see Proxy cache)
silverlight isolated storage (see Silverlight)
SQL server, 118
ViewState (see ViewState)
web applications, 62
web server (see Web server cache)
Cache at all tiers, 8
Capacity planning, 377
Cascading style sheets (CSS)
minimization, 26
optimization
advantages, 43
cascade style, 46
style properties, 42
round-trip elimination
Add Custom HTTP Response Header, 36
client-side caching, 35
disadvantages, 37
embedded <style> section, 36
<link> tag, 35
page onload handler, 35
proxies and http.sys caching, 37
Set-Cookie HTTP header, 36
web.config file, 36
tableless layout
absolute positioning concepts, 56
benefits, 55
ctr class, 57
<div> tags, 57
liquid layout, 57
three-column tableless layout, 58
CellSet object, 359
Ajax
features, 49
jQuery, 51
server round-trip avoidance, 49
XmlHttpRequest control, 50
background gradients, 25
browser page processing
network connections and initial HTTP request, 14–16
page parsing and new resource requests, 16
page resource order and reordering, 17–18
compression algorithm, 27
cookie path property, 42
CSS (see Cascading style sheets)
DSL connection, 41
field separator/ASP.NET dictionary cookie mechanism, 42
gotlogo() function, 26
HTML, 13
minimization, 26
image optimization
background images, 28
client-side image maps, 31
image compression and dimensions, 29–31
image format, 29
image size attributes, 32
image slicing, 31
number of images, minimization, 27
transparency style, 27
image sprites and clustering
CSS creation, 47
display: block property, 47
hover selector, 48
image editor, 46
image src property, 48
<img> tag, 48
web page, 48
JavaScript (see JavaScript)
layout and rendering speed, 51–53
Lucida Handwriting font, 26
<meta refresh> tags, 32
network optimizations
ASP.NET control adapter, 21
host domain, 19
page onload handler, 26
Set-Cookie header, 41
<span> tags, 32
.txtlogo span CSS selector, 26
User-Agent string, 41
web site icon file, 32
Clustered and nonclustered index, 416
clustered index addition, 283–284
covered index creation, 286–287
definition, 280
fragmentation, 287
key lookup process, 280
nonclustered index addition, 285–286
Clusters, 379
<col> tag, 411
Command batching
parameterized command string, 267–268
SqlDataAdapter
adapter.Update(), 265
batch size, 263
DataTable creation, 264
for inserts, updates and deletes, 263–264
limitations, 266
SqlCommand object creation, 264–265
UpdateBatchSize, 265
UpdatedRowSource, 265
CommandNotification, 107
Common table expressions (CTEs), 290
Community Technology Previews (CTPs), 403
CompletedSynchronously flag, 178
compressionEnabled property, 189
Connection Manager dialog box, 360, 361
Content distribution network (CDN), 5
Context.Items object, 412
Contig software, 10
Cookies, 198
caching mechanism, 76
definition, 76
JavaScript, 76
name/value pairs, 77
property
domain, 79
expires, 78
HttpOnly, 80
management, 86
read, 81
secure, 80
session cookie, 77
WCF services, 77
web storage, 87
definition, 372
guidelines, 372
Logins and Ave Users, 374
named categories, 373
perfmon, 372
Performance Monitor Users group, 374
single/multi-instance, 375
types, 372
Cross-site request forgery (CSRF), 71
Database write performance, 191
DataBind() function, 163
Data generator, 340
Data marts, 368
Data Source View (DSV), 338, 341
Data tier architecture, 368
Data warehouses, 368
dbcc dropcleanbuffers, 349
Defense-in-depth techniques, 96
Define Relationship dialog box, 346
Depth–first development (DFD), 404
Dequeue() method, 183
dhref property, 38
Dictionary cookie, 77
Dimensions, 344
usage panel, 346
Wizard, 344
Disks, 377
benchmarks, 386
controller cache, 385
controller throughput, 384
CrystalDiskMark, 387
elevator algorithm, 384
performance measurement, 378
platter and heads, 378
RAID options, 382
RAID 0, 382
RAID 1, 382
RAID 10, 383
RAID 3, 383
RAID 5, 382
RAID 6, 383
recommendations, 383
SANs, 385
SSDs, 385
striping, 382
Dispose() methods, 174
DNS servers, 392
<!DOCTYPE> tag, 411
DoDirMonitoringForUnc registry property, 97
Drop outdated cache option, 365
-E flag, 188
Email,Service Broker
background worker thread, 315–316
message reading and processing, 316–319
remote SMPT server, 315
results, 321
web form, message queue, 319–321
Enable proactive caching check box, 365
Enable ROLAP aggregations option, 366
EnableSessionState property, 191
EnableViewState property, 209
Encrypted cookies, 82
EndAsyncHandler method, 185
EndExecuteNonQuery() method, 166
EndRead() method, 177
EndsWith (tail) match, 80
End-to-End Web page processing, 5–7
Enqueue() method, 182
Entity Framework(EF), 296, 417
Environment and tools
Author’s web site, 12
cross-browser compatibility, 10
Net Applications, 10
software tools and versions, 10–11
terminology, 12
typographic conventions, 12
Escrow, 403
ExecuteCellSet() method, 359
executeInParallel flag, 170, 171
executeInParallel value, 170
ExecuteNonQuery() method, 167
ExecuteRegisteredAsyncTasks() method, 171
Explore Data option, 343
Export Template Wizard, 74
Export, transform, and load (ETL) process, 368, 369
Expression Web, 11
Failed Request Tracing, 414
Fiddler Web Debugger, 11
FileStream object, 177
FileStream.ReadAsync() method, 177
Firebug, 11
Firefox, 11
Firewalls and Routers, 390
GetPlaceFactsAsync() method, 176
GetResponseAsync() method, 178
GetVaryByCustomString() method, 415
GIF format, 410
gotlogo() function, 26
<head> section, 17
Heisenberg Uncertainty Principle, 400
High-impact core architectural, 8
href property, 38
HttpApplicationState object, 412
HttpHandler object, 415
HttpOnly property, 80
http.sys driver, 101
Hybrid OLAP (HOLAP) mode, 363
IAsyncResult, 185
IDisposable objects, 180
IIS 6.0 Resource Kit Tools, 100
Infrastructure and operations, 371
capacity planning, 377
deployment, 393
data tier upgrades, 394
image-based deployment, 395
page compilation, 395
disk subsystems, 377
DNS, 392
firewalls and routers, 390
instrumentation (see Counters)
load balancing, 391
network design, 387
jumbo frames, 388
link aggregation, 389
server monitoring, 396
database perspective, 396
MTTR, 396
performance counters, 397
SCOM, 397
user perspective, 396
window event logs, 397
staging environments, 393
InProc mode, 188
Internet explorer software, 11
Internet Information Services (IIS) 7.5
AppPool
advanced settings, 124
multiple web sites, 125
recycling, 125
compression
advantages, 138
compress.config, 140
configuring, 141
content, caching, 142
disadvantages, 138
dynamic compression, 142
gzip and deflate algorithm, 140
keep-alives, 142
failed request tracing
content specifying, 153
enabling, 156
FailedReqLogFiles folder, 156
HTTPSYS_CACHEABLE line, 156
trace conditions defining, 154
trace providers selecting, 155
WWW Server, 154
HTTP issues
applicationHost.config file, 133
ETag header, 137
HTTP 1.1 headers, 138
404 Not Found errors, 132
X-Aspnet-version header, 135–136
performance tuning, 157
request-processing pipeline, 126–127
traffic and bandwidth managing
site maps, 149
URL
web gardens, 125
WSRM
Add Rule dialog box, 128
Add/Edit Resource Allocation dialog box, 130
Catalog, 127
Catalog AppPool, 128
CPU limitations, 131
CPU time, 130
features, 132
New Process Matching Criteria dialog box, 128, 129
New Resource Allocation Policy dialog box, 131
process matching criteria, 127
Server Manager, 127
Trans, 127
IPartitionResolver interface, 194
ISerializable interface, 197
ISessionIDManager interface, 193
JavaScript, 76
grouping and placement
<script async>, 25
<script defer>, 24
images and objects request, 24
inline document.write(), 21, 22
mid-document script, 21
minimization, 26
performance optimization, 58
JPEG format, 410
KeepAlive, 101
Leaf data, 363
LIKE clause, 196
Link aggregation, 389
Load balancing, 391
network, 391
reverse, 392
LoadPageStateFromPersistenceMedium, 75–76
Lock() method, 113
LoginButton_Click, 89
Log Parser, 11
LosFormatter, 75
Lossless images, 410
maxConcurrentRequestsPerCPU parameter, 169
maxConcurrentThreadsPerCPU parameter, 169
Maximum transmission unit (MTU), 16
MDDBs. See Multidimensional databases
MDX. See Multidimensional Expressions
Measure group data, 363
Measures, 344
Message authentication code (MAC), 71
MethodName property, 105
Microsoft TerraServer system, 174
Microsoft Velocity, 191
Minimize blocking calls, 8
Mirroring, 382
Modulo function, 192
MSF Agile process, 401
M2 testing phase, 402
Multidimensional database (MDDB), 337, 338
cube creation, 344
data source view
client tools installation, 341–342
Explore Data option, 343
named calculation, 343
SSDT, 341
deployment and testing, 348–349
items and users dimensions, 346–347
Multidimensional Expressions (MDX), 338
children, quarter dimension, 353
health category, 353
index, 350
LASTPERIODS() function, 354
NONEMPTY() function, 353
null rows and columns filter, 353
sets, 355
subcategory, 353
SUM() function, 354
TOPCOUNT() function, 352
tuple, 353
Vote Ave, 352
WHERE clause, 351
WITH MEMBER clause, 354
Multidimensional OLAP (MOLAP) mode, 363
Native Command Queuing (NCQ), 378
.NET Framework, cost, 11
.NET garbage collector (GC), 117
New Named Calculation dialog box, 343
NHibernate, 417
NTFS fragmentation, 418
N-tier architecture, 409
Object Relational Model (ORM), 296
Office, cost, 11
OnLoad() style methods, 415
Optimize disk I/O management, 9
OutputCache directive, 102
PageAsyncTask constructor, 170–172
PageAsyncTask object, 165
PageHandler, 162
Partition Storage Settings dialog box, 363, 364
PartitionResolverType property, 195
P1 bugs, 403
P2 bugs, 403
P3 bugs, 403
P4 bugs, 403
Permanent cookies, 187
PNG format, 410
Port trunking/NIC teaming, 389
Precaching, 118
Primary XML index, 301
Priority zero (P0) bug, 403
Proactive monitoring, 396
ProcessCube.dtsx file, 362
Product Group product, 401
Proxy cache
Accept-Language header, 96
cache-control HTTP header
ASP.NET runtime marks, 94
cookies and authentication, 95
SetCacheability, 95
SetNoServerCaching(), 95
static content, 96
defense-in-depth techniques, 96
filtering and logging, 94
HTTP, 94
invisible, 94
VaryByHeaders, 96
visible proxy, 94
Quality-based exit criteria, 402
Queue Length parameter, 169
QueuePageView() method, 182–183, 185
QueueUserWorkItem() method, 179
Random class, 193
Read-heavy workloads, 417
Reduce round trips, 8
RegisterAsyncTask() method, 165
Register directive, 211
RegisterScriptableObject(), 92
Relational database management system (RDBMS), 337
Relational OLAP (ROLAP) mode, 363
ReleaseReaderLock() method, 186
ReleaseRequestState event, 196
RemoveOutputCacheItem() method, 106
Render() method, 162
RequestInfo object, 180–181, 185
Resolved bugs, 403
ResolvePartition() method, 194–195
Resource Governor, 417
Response.IsClientConnected flag, 416
RijndaelManaged Cryptor, 82
ROLAP mode, 367
SavePageStateToPersistenceMedium method, 75–76
Scalability and performance, 2
Semaphore object, 181
Serializable classes, 197
Server monitoring, 396
Server.Transfer() method, 415
Service Broker, 417
Session state
alternatives, 198
HTTP protocol, 187
InProc mode, 188
management, 187
scaling
custom session ID manager, 192–195
scaling out, 192
scaling up, 191
serialization cost, 191
StateServer, 188
SessionIDManager class, 193
sessionIDManagerType property, 195
SetLength() method, 178
setTimeout() property, 38
SetValidUntilExpires() method, 111
Showstopper bugs, 403
Silence interval, 365
silence override interval, 365
Silverlight, 198
cookies, 78
isolated storage
deploying and updating, 93
HTML and user’s experience, 91–92
LoginButton_Click(), 91
MainPage.xaml.cs, 89
Page_Loaded() method, 89
sample application, 88
site-specific, 87
<TextBox> control, 90
Slowly changing dimension (SCD), 369
Software development process
ad hoc process, 400
architecture
block diagram, 408
draft diagram, 409
N-tier architecture, 409
SqlDependency type caching, 409
three-tier architecture, 409
tiers, 409
two-tier server architecture, 409
ASP.NET
optimization management, 414–415
threads and sessions, 414
bug tracking, 403
coding, 402
cost, features, schedule, and quality, 400
design phase, 400
establishment, 399
infrastructure and operations, 418–419
organization, 401
principles and method, 409
project phases and milestones, 401–402
solid infrastructure, 400
SQL server analysis services, 418
SQL server relational database, 416–418
staffing, 400
system architecture, 400
testing, 403
ultra–fast spin
brown bag talks, 405
depth–first development, 404
formal coding standards, 405
FxCop tool, 406
refactoring code, 405
source code control, 405
user feedback, 403
Solid state disks (SSDs), 9, 385
SqlCacheDependency, 107, 117, 417
sqlConnectionString property, 189
SqlDependency
object, 417
property, 107
type caching, 409
SQL Server analysis services (SSAS), 418
ADOMD.NET (see ADOMD.NET)
aggregation queries, 337
cube
definition, 337
data source, 338
dimensions, 338
disadvatages, 338
DSV, 338
facts, 338
MDDB (see Multidimensional database)
MDX queries (see Multidimensional Expressions)
proactive caching, 338
slice, 337
SQL Server Data Tools (SSDT), 11, 341
SQL Server Express, 119
SQL Server Feature Pack, cost, 11
SQL Server Integration Services (SSIS), 338, 360
SQL Server Management Studio (SSMS), 271, 338
SQL Server Relational Database, 416–418
command batching (see Command batching)
data access layer
AddBrowserBegin() method, 279
AddBrowserEnd() method, 279
asynchronous programming model, 278
connection and transaction management, 280
data access code, 278
synchronous database commands, 278
task-based asynchronous pattern, 279
data change notifications
change event handler, 322
data registration, 322
mechanism, 322
SqlCacheDependency class, 322
data paging, 289
common table expressions, 290
OFFSET, 290
output, 295
stored procedure, 292
data partitioning
index addition, 305
Lock Escalation configuration, 305
old data archiving, 306
partition function, 303
partition scheme, 303
SQLEnterprise and Developer, 303
tables, performance issues, 302
data precaching
forms-based data, 277
multiserver load-balanced web tier, 276–277
full-text search
clustered index creation, 307
full-text catalog and index, 307–308
full-text queries, 308
rank details, 309
table creation, 307
T-SQL LIKE clause with wildcard, 306
LINQ to SQL, 296
Entity Framework, 296
limitations, 296
Object Relational Model, 296
TIMESTAMP column, 297
T-SQL command, 296
memory management
memory organization, 260
performance impact, 261
multiple result sets
SqlDataAdapter and dataset, 275–276
SqlDataReader.NextResult(), 274–275
stored procedure, 274
query and schema optimization, 280
clustered and nonclustered index (see Clustered and nonclustered index)
high-level guidelines, 289
resource governor
advantages, 326
scaling up vs. scaling out, 330
memory manager, 333
physicaldisk, 332
processor, 332
scaling up, 330
Service Broker
configuartion, 311
Email (see Email,Service Broker)
poisoned message avoidance, 313
single batch commands, 313
single database server, database object types, 310
table-based FIFO queues, 314
vs. thread task, 310
time-shift long-running tasks, 310
transactions
BEGIN and COMMIT statements, 270
conn.BeginTransaction(), 269
insert performance, 269
record writing, 268
sql-batch3.aspx, 269
table-valued parameters, 271–273
transaction size and length, 269
XML columns (see XML columns)
SQL Server Reporting Services (SSRS), 338
Sql-sync.aspx, 164
SSAS. See SQL Server Analysis Services
Staging environments, 393
State information. See Session state
State object, 171
StateServer, 188
Storage array networks (SANs), 385
SYN and SYN ACK packets, 16
Synchronous page, 164
vs. asynchronous load tests
configuration file, 167
IIS application thread pool, 169–170
test script, 167
WCAT tool, 167
System Center Operations Manager (SCOM), 11, 397, 419
Target Server Memory (KB), 333
Task–based asynchronous pattern (TAP), 166–167, 279
Technical Assistance Program (TAP), 403
Temporary cookies, 187
Test–driven development (TDD), 404
Three-tier architecture, 409
Timeout property, 189
TimeSpan, 115
Transparent proxy, 7
Two–tier server architecture, 409
Ultra-fast and ultra-scalable approach
goals, 2
optimization, 3
process, 4
speed and scalability, 2
user experience, 5
Universal Naming Convention (UNC) file, 97
UnLock() method, 113
Update the cache periodically option, 366
<urlCompression> tag, 413
User controls
control output caching
dollar sign, 204
Page_Load() method, 205
PartialCaching attribute, 205
ResolveUrl(), 205
store and retrieve information, 204
VaryByControl, 204
placing, 205
registration, 205
templated controls
ControlsFrame.ascx, 206
<ct:Frame> tag, 208
HeaderText property, 206
OnInit event, 207
OnPreRender event, 207
Validate() method, 194
VaryByCustom function, 412
VaryByHeaders, 96
ViewState
control tree, 68
definition, 67
manage, 69
multi-server environment, 70
object, 187
page-rendering process, 68
PreInit event, 68
protecting data integrity
ASP.NET controls, 73
BinaryFormatter, 75
CSRF, 71
EnableViewState, 73
IP addresses, 72
LoadPageStateFromPersistenceMedium method, 75–76
LosFormatter, 75
MAC, 71
SavePageStateToPersistenceMedium method, 75–76
session ID, 72
TypeConverter, 75
upload times, 72
validationKey, 71
ViewStateMode, 73
ViewStateUserKey property, 71
server-only objects, 70
__VIEWSTATE field, 69
Vision statement, 402
Visual Studio software, 11
waitfor command, 173
Wait() method, 183
Web architecture model, 5
Web proxy. See Proxy cache
Web server cache
ASP.NET object caching
CacheItemPriority, 115
file-based dependency, 115
global scope and indefinite lifetime, 113
HttpContext.Items, 113
thread safe, 114
TimeSpan, 115
ASP.NET output caching
disable, 105
outputCache directive, 103
substitution caching, 105
VaryByCustom property, 109
windows Kernel cache
applicationHost.config, 100
dynamic files, 99
enable http.sys caching, 98
kernel-mode HTTP driver, 96
performance comparison, 100–102
Web storage, 198
WelcomeMessage() method, 92
whitespace filtering, 416
Windows Deployment Services (WDS), 395
Windows performance counters. See Counters
Windows Server, cost, 11
Windows system resource manager (WSRM)
Add Rule dialog box, 128
Add/Edit Resource Allocation dialog box, 130
Catalog, 127
Catalog AppPool, 128
CPU limitations, 131
CPU time, 130
features, 132
New Process Matching Criteria dialog box, 128, 129
New Resource Allocation Policy dialog box, 131
process matching criteria, 127
Server Manager, 127
Trans, 127
Wireshark software, 11
WorkItem class, 181
workItemLockObject, 181
.xap files, 93
XML columns
performance perspectives, 297
table creation, 299
XMLA language, 338
YSlow software, 11
Zero bug bounce (ZBB), 402
3.148.104.242