30
@Dynatrace - Get Dynatrace: http://bit.ly/dtpersonal - More YouTube Tutorials: http://bit.ly/dttutorials Hosted by: Andreas Grabner (@grabnerandi & [email protected]) Ask questions using the Questions Tab – or post on answers.dynatrace.com Four Practices for Fixing Your Top .NET Performance Problems

Four Practices to Fix Your Top .NET Performance Problems

Embed Size (px)

Citation preview

@Dynatrace

- Get Dynatrace: http://bit.ly/dtpersonal- More YouTube Tutorials: http://bit.ly/dttutorialsHosted by: Andreas Grabner (@grabnerandi & [email protected])Ask questions using the Questions Tab – or post on answers.dynatrace.com

Four Practices for Fixing Your Top .NET Performance Problems

@Dynatrace

• Top Problems I’ve seen in the years thanks to http://bit.ly/sharepurepath• How to

• Instrument ASP.NET, IIS and Common Mistakes• Process Performance Analysis:

• CPU, Memory & Thread Hotspots• Monitoring through Windows Performance Counters

• Application Performance Analysis• Error, Exception and Log Analysis• Database Hotspots: SQL + Bind Values, Connection Pool Information• Method Hotspots, Synchronous vs Asynchronous Executions• Monitoring Thread Pools and Other Queues using JMX

• Live Q&A

Agenda for Today

WHERE? HOW?

WHAT?

HOW?

WHAT?

Browser Issue?

Bandwidth Issue? OS Issue?

Geo Issue?Why Frustrated?

Beautiful but Heavy Pages

32! JavaScript files

5MB! In Size

W3C Resource Timings!

#1: # of Resources

#2: Total Page Size

#3: Involved Domains

10 @Dynatrace

Too Many Queries crash

Undersized Pools

Online Banking: Slow Balance Check

1.69m (=101s!) To Check Balance!

87% spent in IIS 600! SQL Executions

#1 Time really spent in IIS?

Tip: Elapsed Time tells us WHEN a Method was executed!

Finding: Thread 32 in IIS waited 87s to pass control to Thread 30 in ASP.NET

Tip: Thread# gives us insight on Thread Queues / Switches

#2 What about these SQL Executions?Finding: EVERY SQL

statement is executed on ITS OWN Connection!

Tip: Look at “GetConnection”

#2 SQL Executions! continued …

#1: Same SQL is executed 67! times

#2: NO PREPARATION because everything

executed on new Connection

Lessons Learned!

ASP.NET Worker Thread Pool Sizing!

DB Connection PoolsMore Efficient SQL

#1: Idle vs. Busy Threads

#2: # SQLs / Request

#3: # GetConnection

Bad Synchronization

Load vs. Memory vs Response Time vs. ThreadsIncreasing Memory

Avg Response Time: Increases over Time

Max Response Time correlates with # Threads

Max Response Time correlates with # Threads

Load: System can’t handle constant load over time

# of Worker Threads increase with constant load

Layer Breakdown: Performance Problem is in their own code (Sync Time)

96% Synchronization TimeMonitor.Enter: By far biggest

performance contributor

Called from GetStatus and _GetDebugStatus. Why also from Debug method? Bug?

Excessive File Attribute Access second hotspot

Can FileExist check be cached to reduce

File Access?

File Access next hotspots

#1: # of Threads vs # Incoming Requests

#2: Time Spent in Sync

#3: Time Spent in I/O

@Dynatrace

• Get Dynatrace Personal License: http://bit.ly/dtpersonal • Download and Install from: http://bit.ly/dttrial •Watch the YouTube Tutorials: http://bit.ly/dttutorials • 2 Steps for Instrumenting .NET and IIS Agent

• .NET Agent Configuration Tool to configure ASP.NET AppPool• Load Dynatrace IIS Web Server Agent Module

• GO! Launch Your App! Analyze Results!

Instrumenting ASP.NET & IIS

@Dynatrace

• IIS not restarted after Agent Installation• IIS only loads AppPool when you access website• Loading 64bit instead of 32Bit Agent IIS Module• Firewall or DNS issues to YOURDTCOLLECTOR:9998•Wrong TIERNAME leading to „Agent didnt match System Profile“

Most Common Mistakes

@Dynatrace

DemoInstrumenting an ASP.NET Application

@Dynatrace

DemoAnalyze Application Performance

@Dynatrace

• Meetups and User Groups: We are happy to present!• Feb 2016: SAP hybris Summit, Chef Seattle, Docker Meetup San Mateo,

DT User Group in Pittsburgh and Cleveland …• Mar 2016: Zurich (Testing Day + Java Meetup), DevConf South Africa,

DT User Groups in Detroit, Columbus and New York City• April 2016: STPCon, DT User Group in San Mateo

• YouTube Channel: http://bit.ly/dttutorials • Dynatrace Personal: http://bit.ly/dtpersonal • Contact: [email protected] • Share Your PurePath: http://bit.ly/sharepurepath

Reminders

Participate in our Forum :: community.dynatrace.com

Like us on Facebook facebook.com/dynatrace

Follow us on LinkedIn linkedin.com/company/dynatrace

Connect with us!Follow us on Twitter twitter.com/dynatrace

Watch our Videos & Demos youtube.com/dynatrace

Read our Blogapplication-performance-blog.com