Date post: | 17-Dec-2015 |
Category: |
Documents |
Upload: | madeline-sharp |
View: | 213 times |
Download: | 0 times |
Troubleshooting Web Troubleshooting Web Site Performance Site Performance Issues with Visual Issues with Visual Studio Team SystemStudio Team System
Martin KulovMartin KulovDirector .NET DevelopmentDirector .NET DevelopmentNational Academy for Software DevelopmentNational Academy for Software Development
MVP – VSTS, MCT, MCSD, MCPDMVP – VSTS, MCT, MCSD, MCPD
What We Will CoverWhat We Will Cover
How testing processes can help us deliver How testing processes can help us deliver quality codequality code
Measuring performance of ASP.NET sitesMeasuring performance of ASP.NET sites
Improving ASP.NET performanceImproving ASP.NET performance
Session PrerequisitesSession Prerequisites
.NET Framework intermediate level.NET Framework intermediate level
ASP.NET intermediate levelASP.NET intermediate level
Windows Counters basic levelWindows Counters basic level
Level 200Level 200
AgendaAgenda
WWW (Why, When, What) to testWWW (Why, When, What) to test
Web Applications TestsWeb Applications Tests
Performance Testing ASP.NET applicationsPerformance Testing ASP.NET applications
Profiling ASP.NET ApplicationsProfiling ASP.NET Applications
Measuring ASP.NET ApplicationsMeasuring ASP.NET Applications
Tuning ASP.NET ApplicationsTuning ASP.NET Applications
Why we should testWhy we should test
Quality increaseQuality increase
Finding and fixing design problemsFinding and fixing design problems
Lowering TCO and maintenance costsLowering TCO and maintenance costs
When we should testWhen we should test
As often as possibleAs often as possible
As early as possibleAs early as possible
Test automation would help a lotTest automation would help a lot
What we should testWhat we should test
Critical business featuresCritical business features
Everything else Everything else The clearer performance goals are, the better The clearer performance goals are, the better we will know what to testwe will know what to test
PMs should get these goals defined from the startPMs should get these goals defined from the start
Testing Web ApplicationsTesting Web ApplicationsTesting typesTesting types
Functional TestingFunctional Testing
Performance TestingPerformance Testing
Security TestingSecurity Testing
Reliability TestingReliability Testing
Usability TestingUsability Testing
others …others …
Performance TestingPerformance Testing
Most critical and often neglected type of testMost critical and often neglected type of test
It should be done during each phase of the It should be done during each phase of the projectproject
There are three main principlesThere are three main principlesMeasureMeasure
MeasureMeasure
MeasureMeasure
Set your desired goalsSet your desired goals
Tune the applicationTune the application
Setting your goalsSetting your goals
Response timeResponse timeLatency on the serverLatency on the server
Latency on the client (TTFB and TTLB)Latency on the client (TTFB and TTLB)
ThroughputThroughput
Resource utilizationResource utilizationIdentify problem areasIdentify problem areas
Define workload profilesDefine workload profiles
Profiling ASP.NET ApplicationsProfiling ASP.NET Applications
Profiling is the process of collecting dataProfiling is the process of collecting data
We can measure the resultWe can measure the result
Profiling is done though code instrumentationProfiling is done though code instrumentation
In instrumentation we inject additional code to In instrumentation we inject additional code to the system so it can generate events the system so it can generate events
System Resources CountersSystem Resources CountersCPU CountersCPU Counters
Processor\% Processor TimeProcessor\% Processor Time
Processor\% Privileged TimeProcessor\% Privileged Time
Processor\% Interrupt TimeProcessor\% Interrupt Time
System\Processor Queue LengthSystem\Processor Queue Length
System\Context Switches/secSystem\Context Switches/sec
System Resources CountersSystem Resources CountersMemory CountersMemory Counters
Memory\Available MbytesMemory\Available Mbytes
Memory\Page Reads/secMemory\Page Reads/sec
Memory\Pages/secMemory\Pages/sec
Memory\Pool Memory\Pool NonpagedNonpaged Bytes Bytes
Server\Pool Server\Pool NonpagedNonpaged Failures Failures
Server\Pool Paged FailuresServer\Pool Paged Failures
Server\Pool Server\Pool NonpagedNonpaged Peak Peak
Memory\Cache BytesMemory\Cache Bytes
Memory\Cache Faults/secMemory\Cache Faults/sec
System Resources CountersSystem Resources CountersNetwork CountersNetwork Counters
Network Interface\Bytes Total/secNetwork Interface\Bytes Total/sec
Network Interface\Bytes Received/secNetwork Interface\Bytes Received/sec
Network Interface\Bytes Sent/secNetwork Interface\Bytes Sent/sec
Server\Bytes Total/secServer\Bytes Total/sec
[[Protocol_ObjectProtocol_Object]]\Segments Received/sec\Segments Received/sec
[[Protocol_ObjectProtocol_Object]]\Segments Sent/sec\Segments Sent/sec
Processor\% Interrupt TimeProcessor\% Interrupt Time
System Resources CountersSystem Resources CountersDisk I/O CountersDisk I/O Counters
PhysicalDisk\Avg. Disk Queue LengthPhysicalDisk\Avg. Disk Queue Length
PhysicalDisk\Avg. Disk Read Queue LengthPhysicalDisk\Avg. Disk Read Queue Length
PhysicalDisk\Avg. Disk Write Queue LengthPhysicalDisk\Avg. Disk Write Queue Length
PhysicalDisk\Avg. Disk sec/ReadPhysicalDisk\Avg. Disk sec/Read
PhysicalDisk\Avg. Disk sec/TransferPhysicalDisk\Avg. Disk sec/Transfer
PhysicalDisk\Disk Writes/secPhysicalDisk\Disk Writes/sec
Managed Code CountersManaged Code CountersMemory CountersMemory Counters
Process\Private Bytes
.NET CLR Memory\% Time in GC
.NET CLR Memory\# Bytes in all Heaps
.NET CLR Memory\# Gen N Collections
.NET CLR Memory\# of Pinned Objects
.NET CLR Memory\Large Object Heap Size
Managed Code CountersManaged Code CountersOther CountersOther Counters
Working SetProcess\Working Set
Exceptions.NET CLR Exceptions\# of Exceps Thrown / sec
Contention.NET CLR LocksAndThreads\Contention Rate/sec
.NET CLR LocksAndThreads\Current Queue Length
Managed Code CountersManaged Code CountersOther CountersOther Counters
Threading.NET CLR LocksAndThreads\# of current physical Threads
Thread\% Processor Time
Thread\Context Switches/sec
Thread\Thread State
Code Access Security.NET CLR Security\Total RunTime Checks
.NET CLR Security\Stack Walk Depth
ASP.NET CountersASP.NET Counters
Worker ProcessASP.NET\Worker Process RestartsASP.NET\Worker Process Restarts
ThroughputASP.NET Applications\Requests/SecASP.NET Applications\Requests/Sec
Web Service\ISAPI Extension Requests/secWeb Service\ISAPI Extension Requests/sec
ASP.NET\Requests CurrentASP.NET\Requests Current
ASP.NET Applications\Requests ExecutingASP.NET Applications\Requests Executing
ASP.NET Applications\Requests Timed OutASP.NET Applications\Requests Timed Out
Response time / latencyASP.NET\ Request Execution TimeASP.NET\ Request Execution Time
ASP.NET CountersASP.NET Counters
CacheASP.NET Applications\Cache Total EntriesASP.NET Applications\Cache Total EntriesASP.NET Applications\Cache Total Hit RatioASP.NET Applications\Cache Total Hit RatioASP.NET Applications\Cache Total Turnover ASP.NET Applications\Cache Total Turnover RateRateASP.NET Applications\Cache API Hit RatioASP.NET Applications\Cache API Hit RatioASP.NET Applications\Cache API Turnover RateASP.NET Applications\Cache API Turnover RateASP.NET Applications\Output Cache EntriesASP.NET Applications\Output Cache EntriesASP.NET Applications\Output Cache Hit RatioASP.NET Applications\Output Cache Hit RatioASP.NET Applications\Output Cache Turnover ASP.NET Applications\Output Cache Turnover RateRate
Tuning ASP.NET ApplicationsTuning ASP.NET ApplicationsTuning ProcessTuning Process
Performance tuning is an iterative processPerformance tuning is an iterative process
On every step we should identify and On every step we should identify and eliminate bottleneckseliminate bottlenecks
Retest and measure again to see if we are Retest and measure again to see if we are closer to our performance goalscloser to our performance goals
Tuning ASP.NET ApplicationsTuning ASP.NET ApplicationsTuning CategoriesTuning Categories
ApplicationApplicationConfiguration settingsConfiguration settings
web.configweb.config
PlatformPlatform.NET Framework.NET Framework
Web ServerWeb Server
OSOS
DatabaseDatabase
SystemSystemCPU, Memory, I/O, etc… CPU, Memory, I/O, etc…
Tuning ASP.NET ApplicationsTuning ASP.NET ApplicationsTune the thread poolTune the thread pool
<processModel>
<processModel enable="true" timeout="Infinite“ <processModel enable="true" timeout="Infinite“ idleTimeout="Infinite“idleTimeout="Infinite“
shutdownTimeout="0:00:05" requestLimit="Infinite"shutdownTimeout="0:00:05" requestLimit="Infinite"requestQueueLimit="5000" restartQueueLimit="10“requestQueueLimit="5000" restartQueueLimit="10“memoryLimit="60“ webGarden="false" cpuMask="0xffffffff" memoryLimit="60“ webGarden="false" cpuMask="0xffffffff" userName="machine“ password="AutoGenerate" userName="machine“ password="AutoGenerate" logLevel="Errors“ clientConnectedCheck="0:00:05“logLevel="Errors“ clientConnectedCheck="0:00:05“comAuthenticationLevel="Connect“ comAuthenticationLevel="Connect“ comImpersonationLevel="Impersonate“comImpersonationLevel="Impersonate“responseDeadlockInterval="00:03:00" responseDeadlockInterval="00:03:00" maxWorkerThreads="20“ maxIoThreads="20"/>maxWorkerThreads="20“ maxIoThreads="20"/>
Tuning ASP.NET ApplicationsTuning ASP.NET ApplicationsTune the thread poolTune the thread pool
<httpRuntime>
<httpRuntime executionTimeout="90" maxRequestLength="4096“<httpRuntime executionTimeout="90" maxRequestLength="4096“useFullyQualifiedRedirectUrl="false" useFullyQualifiedRedirectUrl="false" minFreeThreads="8"minFreeThreads="8"minLocalRequestFreeThreads="4" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"appRequestQueueLimit="100"enableVersionHeader="true"/>enableVersionHeader="true"/>
Tuning ASP.NET ApplicationsTuning ASP.NET ApplicationsRecommended settingsRecommended settings
Recommended Threading Settings for Reducing Contention
Configuration setting Default (.NET 1.1) Recommended valuemaxconnection 22 12 * #CPUs
maxIoThreads 2020 100100
maxWorkerThreads 2020 100100
minFreeThreads 88 88 * #CPUs
minLocalRequestFree-Threads
44 76 * #CPUs
Tuning ASP.NET ApplicationsTuning ASP.NET ApplicationsOther settingsOther settings
Set memory limit<processModel ... memoryLimit="60" .../>
IIS 6.0 manager
Set timeouts<httpRuntime executionTimeout="90" />
<processModel responseDeadlockInterval="00:03:00" />
Evaluate use of RequestQueueLimit<processModel enable="true" requestQueueLimit="5000" />
Tuning ASP.NET ApplicationsTuning ASP.NET ApplicationsOther settingsOther settings
Disable tracing and debugging
Disable session state<sessionState mode="off" /><sessionState timeout="20"/>
Disable View State<pages enabledViewState="false" />
<configuration><configuration><system.web><system.web>
<trace enabled="false" pageOutput="false" /<trace enabled="false" pageOutput="false" />><compilation debug="false" /><compilation debug="false" />
</system.web></system.web></configuration></configuration>
Demonstration 1Demonstration 1
Profiling and load testing ASP.NET Profiling and load testing ASP.NET applications with Visual Studio Team applications with Visual Studio Team System 2005 for Software TestersSystem 2005 for Software Testers
Session SummarySession Summary
The inevitable software testing processThe inevitable software testing process
Measuring performance of ASP.NET Measuring performance of ASP.NET applicationsapplications
Tuning performance of ASP.NET applicationsTuning performance of ASP.NET applications
Visual Studio Team System 2005 for Visual Studio Team System 2005 for Software Testing provide integrated profiling, Software Testing provide integrated profiling, load testing and reporting environmentload testing and reporting environment
Next StepsNext Steps
Create load profiles for your applicationCreate load profiles for your application
Prepare and analyze reports from load testingPrepare and analyze reports from load testing
Identify and resolve bottlenecksIdentify and resolve bottlenecks
Tune Windows OS performanceTune Windows OS performance
Tune ADO.NET performanceTune ADO.NET performance
Tune SQL Server performanceTune SQL Server performance
For More InformationFor More Information
Microsoft patterns & practicesMicrosoft patterns & practiceshttp://msdn.microsoft.com/practices/http://msdn.microsoft.com/practices/
Improving .NET Application Performance and Improving .NET Application Performance and ScalabilityScalability
http://msdn.microsoft.com/library/default.asp?http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenet.aspurl=/library/en-us/dnpag/html/scalenet.asp
Additional ResourcesAdditional Resources
Rico Rico Mariani’sMariani’s blogbloghttp://blogs.msdn.com/ricom/http://blogs.msdn.com/ricom/
Maoni'sMaoni's WebLogWebLoghttp://http://blogs.msdn.com/maoni/blogs.msdn.com/maoni/
Bulgarian Association of Software DevelopersBulgarian Association of Software Developershttp://http://www.devbg.orgwww.devbg.org
http://http://academy.devbg.orgacademy.devbg.org
Martin Martin Kulov’s blogKulov’s bloghttp://www.codeattest.com/blogs/martinhttp://www.codeattest.com/blogs/martin
Questions and AnswersQuestions and Answers
Submit text questions using the “Ask” button. Submit text questions using the “Ask” button.
Don’t forget to fill out the survey.Don’t forget to fill out the survey.
For upcoming and previously live webcasts: For upcoming and previously live webcasts: www.microsoft.com/webcastswww.microsoft.com/webcasts
Got webcast content ideas? Contact us at: Got webcast content ideas? Contact us at: http://http://go.microsoft.com/fwlink/?LinkIdgo.microsoft.com/fwlink/?LinkId=41781=41781
Today's webcast was presented using Microsoft Today's webcast was presented using Microsoft Office Live Meeting. Get a free 14- day trial by Office Live Meeting. Get a free 14- day trial by visiting: visiting: http://www.microsoft.com/http://www.microsoft.com/presentlivepresentlive