SlideShare a Scribd company logo
1 of 23
.Net Performance Architecture
& Tuning
GauranG B ajpai
L e a d P e rfo rm a n c e E n g in e e r
Agenda
➢ Overview
➢ Key Take Aways
➢ ASP.NET Architecture
➢ ASP.Net Application Types
➢ .Net Framework
➢ .Net Framework Content
➢ Compilation & Execution
➢ .Net Tools
➢ A few .NET Performance Counters
- Use case 1: Application Consuming lot of memory
- Use Case 2: throwing lot of exceptions unnecessarily
- Use Case 3: Application Takes too long to Load
- Use Case 4: FileNotFoundException
- Use Case 5: Application is Slow To Load
- Use Case 6: Memory Leak Problem
- Use Case 7: PInvoke Issues
 Short note on ASP.NET specific counters
Key Take Aways…
● Understanding of .Net architecture and Framework.
● Understanding reasons behind common performance issues that a .NET
developer faces day to day.
● How to leverage the tools in .NET framework to solve day to day issues…
● Performance: What and How…
● MOST IMPORTANT: The POWER of .NET framework…
ASP.NET Architecture
● Web clients communicate with ASP.NET
applications through IIS.
● IIS authenticates the request.
● If “Allow Anonymous” is turned on,
no authentication occurs.
● IIS also finds the requested resource.
● If the Client is authorized, IIS returns the
appropriate resource.
ASP.NET Application Types
 Two types of Applications:
 Web Forms.
 XML web services.
 Web forms allow us to build form-based web pages .We can use ASP.NET server
controls to create common UI elements, and program them for common task.
 XML Web services are software applications that use XML to exchange data
(information) with other applications on other computers by using Internet
protocols.
.Net
Framework
Inside the .NET Framework
 : Provides every language running on .NET platform
with a base set of Data Types.
– Everything in the CTS is an object
– Most languages implement aliases to those types
– e.g. a four-byte integer value is represented by the CTS type System.Int32
but C# defines an alias for this type called int.
 The CLS is a set of rules that a language
compiler must follow in order to create .NET applications
– The CLS defines the following things
Common variable types (called CTS )
Common visibility like when and where can one see these variables,
Common method specifications, and so on.
Inside the .NET Framework...
 Manages the execution of code compiled for
the .NET platform.
Following Steps occur in CLR:
– Managed Code created by VB or C# compilers and converted into .
– MSIL contains the and the .
– MSIL is kept in a file called along with .
– CLR loads and verifies the assembly to make sure that IL is ok.
– in CLR converts this IL to machine code.
– - Automatic allocation and release of Memory.
– allow us to interact with the runtime, & provide additional
useful functionality. Provides services and Objects needed to write
applications.
Compilation
&
Execution
.NET Tools…the hidden gems
● FusLogVW.exe – Fusion Log Viewer
● NGEN.exe – Native Image Generator
● ILAsm.exe, ILDAsm.exe – IL Assembler and Dis-assembler
● MDA – Managed Debugging Assistants
● SoS.dll
Perfmon: What is it?
● The name says it all.
● Used to monitor the performance parameters of the system and the user
applications.
● How to use it?
● What are the parameters that we can track?
A few .NET Performance Counters
● .NET CLR Memory Counters
● .NET CLR Exceptions
● .NET CLR Loading
● .NET CLR JIT
● Processor
● Memory
Scenario I: Application Consuming lot of
memory
 What should I look at?
 # bytes in all Heaps increasing
 Indicators: Memory Leak?
 # bytes in all Heaps increasing
 Gen 2 Heap Size increasing
 # GC handles increasing
 # total committed/Reserved Bytes increasing
 % Time in GC
Application Consuming lot of memory.....
 Indicators: Memory Fragmentation?
 # total reserved Bytes significantly larger than # total committed Bytes
 # of Pinned Objects increasing
 # GC handles increasing
 # bytes in all heaps always increasing
Scenario 2: Application throwing lot of
exceptions unnecessarily…
 Cost of throwing an exception
 What else can go wrong?
 Blocking exception handlers
 Loss of exception context
 Perfmon Exception counters to look at:
 # of Exceps Thrown
 # of Exceps Thrown / Sec
 # of Filters / Sec
 Throw to Catch Depth / Sec
Scenario 3: Application Takes too long time to
Load
Possible Reasons:
 Too many assemblies to load
 Too much of jitting happening
 Perfmon counters to look at:
 % Time in Loading
 Current Assemblies
 Rate of Assemblies/AppDomains
 # of IL Bytes JITted
 # of methods JITed
 % time in JIT
Scenario 4: FileNotFoundException
“Our application ran successfully on the Development machine but it is failing with
FileNotFoundException when we deploy it in production.”
● Fusion – How the CLR locates assemblies.
● How can the fusion log viewer help us here
● How to look into the Fusion Log
● Fusion Log Viewer: Fuslogvw.exe
● Demo
Scenario 5: Slow To Load
“Our application takes too long to load for the first time. It exhibits the same
behavior once in a while…”
● What happens when a .NET application runs for the first time
● Native Images and how they speed up the loading process
● NGEN: Native image generation
● How NGEN will help us here
● Demo
Scenario 6: Memory Leak
“My application is consuming lot of memory. It looks like a ‘Memory Leak’ to
me…”
● .NET Memory Manager: GC
● How to get managed heap information
● How the CLRProfiler can help us here
● Demo
Scenario 7: PInvoke Issues
“I used PInvoke to call a native API, I’m doing everything correct, but the call is
failing/ the application is failing with AccessViolationException…”
● Crucial to match the native API signature exactly without any exception
● What is MDA
● How MDA will help us here
● Demo
Short note on ASP.NET specific counters
 Two types:
 – System Counters
 – Application Counters
 Few important Counters:
 ASP.NET/Application Restarts.
 ASP.NET/Requests Queued
 ASP.NET Application/Requests/sec
 ASP.NET Application/Errors Total
 AND many more…
.NET Application Performance
 Performance is a relative term:
 What is good for you may not be good for others.
 Performance Bottlenecks in .NET:
 Am I loading too many assemblies at the start?
 Am I misusing Exceptions and defeating their purpose ?
 Am I doing too many memory operations? Am I trying to deal with the
memory management on my own?
 The list is long…
Thanks !

More Related Content

What's hot

Concurrent Ruby Application Servers
Concurrent Ruby Application ServersConcurrent Ruby Application Servers
Concurrent Ruby Application ServersLin Jen-Shin
 
Ruby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay ShanghaiRuby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay ShanghaiJackson Tian
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Alin Pandichi
 
How to build a tool for operating Flink on Kubernetes
How to build a tool for operating Flink on KubernetesHow to build a tool for operating Flink on Kubernetes
How to build a tool for operating Flink on KubernetesAndreaMedeghini
 
On component interface
On component interfaceOn component interface
On component interfaceLaurence Chen
 
A simple tool for debug (tap>)
A simple tool for debug (tap>)A simple tool for debug (tap>)
A simple tool for debug (tap>)Laurence Chen
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonDomingo Suarez Torres
 
Java concurrency
Java concurrencyJava concurrency
Java concurrencyfbenault
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneMichael Kuehne-Schlinkert
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...OdessaJS Conf
 
Dangers of parallel streams
Dangers of parallel streamsDangers of parallel streams
Dangers of parallel streamsLukáš Křečan
 
Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...
Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...
Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...Igalia
 

What's hot (20)

Concurrent Ruby Application Servers
Concurrent Ruby Application ServersConcurrent Ruby Application Servers
Concurrent Ruby Application Servers
 
Add a backend and deploy!
Add a backend and deploy!Add a backend and deploy!
Add a backend and deploy!
 
Event Machine
Event MachineEvent Machine
Event Machine
 
Grape golilath
Grape golilathGrape golilath
Grape golilath
 
Ruby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay ShanghaiRuby vs Node ShiningRay Shanghai
Ruby vs Node ShiningRay Shanghai
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
 
How to build a tool for operating Flink on Kubernetes
How to build a tool for operating Flink on KubernetesHow to build a tool for operating Flink on Kubernetes
How to build a tool for operating Flink on Kubernetes
 
On component interface
On component interfaceOn component interface
On component interface
 
A simple tool for debug (tap>)
A simple tool for debug (tap>)A simple tool for debug (tap>)
A simple tool for debug (tap>)
 
Intro to RxJS
Intro to RxJSIntro to RxJS
Intro to RxJS
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
 
Build a chatroom!
Build a chatroom!Build a chatroom!
Build a chatroom!
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael KuehneTDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
 
Test driving QML
Test driving QMLTest driving QML
Test driving QML
 
Dangers of parallel streams
Dangers of parallel streamsDangers of parallel streams
Dangers of parallel streams
 
Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...
Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...
Partial Continuations, Lessons From JavaScript and Guile in 2012 (Quasiconf 2...
 
MCQs on SignalR
MCQs on SignalRMCQs on SignalR
MCQs on SignalR
 

Similar to .Net Architecture and Performance Tuning

Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthScyllaDB
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012Ashish Bhasin
 
Production debugging web applications
Production debugging web applicationsProduction debugging web applications
Production debugging web applicationsIdo Flatow
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 
Production Debugging War Stories
Production Debugging War StoriesProduction Debugging War Stories
Production Debugging War StoriesIdo Flatow
 
SigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model TrainingSigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model TrainingSigOpt
 
Alexandra johnson reducing operational barriers to model training
Alexandra johnson   reducing operational barriers to model trainingAlexandra johnson   reducing operational barriers to model training
Alexandra johnson reducing operational barriers to model trainingMLconf
 
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"LogeekNightUkraine
 
Learn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptxLearn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptxGaytriMate
 
JavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveJavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveAndreas Grabner
 
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...GetInData
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuningJerry Kurian
 
Knowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular CompilationKnowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular CompilationMd.Zahidur Rahman
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingShyam Sunder Verma
 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning InfrastructureSigOpt
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyBrian Lyttle
 
Top 10 Tricks and Tools of an Oracle EPM Administrator
Top 10 Tricks and Tools of an Oracle EPM AdministratorTop 10 Tricks and Tools of an Oracle EPM Administrator
Top 10 Tricks and Tools of an Oracle EPM Administratornking821
 

Similar to .Net Architecture and Performance Tuning (20)

Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster Health
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012
 
Production debugging web applications
Production debugging web applicationsProduction debugging web applications
Production debugging web applications
 
C# and dot net framework
C# and dot net frameworkC# and dot net framework
C# and dot net framework
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
Production Debugging War Stories
Production Debugging War StoriesProduction Debugging War Stories
Production Debugging War Stories
 
SigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model TrainingSigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model Training
 
Alexandra johnson reducing operational barriers to model training
Alexandra johnson   reducing operational barriers to model trainingAlexandra johnson   reducing operational barriers to model training
Alexandra johnson reducing operational barriers to model training
 
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
 
Learn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptxLearn the java basic programming with example and syntaxchapter1-part-b.pptx
Learn the java basic programming with example and syntaxchapter1-part-b.pptx
 
JavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveJavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep Dive
 
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Knowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular CompilationKnowledge Sharing Session on JavaScript Source Maps & Angular Compilation
Knowledge Sharing Session on JavaScript Source Maps & Angular Compilation
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
Node.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniquesNode.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniques
 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning Infrastructure
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp Philly
 
Asp.net new
Asp.net newAsp.net new
Asp.net new
 
Top 10 Tricks and Tools of an Oracle EPM Administrator
Top 10 Tricks and Tools of an Oracle EPM AdministratorTop 10 Tricks and Tools of an Oracle EPM Administrator
Top 10 Tricks and Tools of an Oracle EPM Administrator
 

Recently uploaded

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 

.Net Architecture and Performance Tuning

  • 1. .Net Performance Architecture & Tuning GauranG B ajpai L e a d P e rfo rm a n c e E n g in e e r
  • 2. Agenda ➢ Overview ➢ Key Take Aways ➢ ASP.NET Architecture ➢ ASP.Net Application Types ➢ .Net Framework ➢ .Net Framework Content ➢ Compilation & Execution ➢ .Net Tools ➢ A few .NET Performance Counters - Use case 1: Application Consuming lot of memory - Use Case 2: throwing lot of exceptions unnecessarily - Use Case 3: Application Takes too long to Load - Use Case 4: FileNotFoundException - Use Case 5: Application is Slow To Load - Use Case 6: Memory Leak Problem - Use Case 7: PInvoke Issues  Short note on ASP.NET specific counters
  • 3. Key Take Aways… ● Understanding of .Net architecture and Framework. ● Understanding reasons behind common performance issues that a .NET developer faces day to day. ● How to leverage the tools in .NET framework to solve day to day issues… ● Performance: What and How… ● MOST IMPORTANT: The POWER of .NET framework…
  • 4. ASP.NET Architecture ● Web clients communicate with ASP.NET applications through IIS. ● IIS authenticates the request. ● If “Allow Anonymous” is turned on, no authentication occurs. ● IIS also finds the requested resource. ● If the Client is authorized, IIS returns the appropriate resource.
  • 5. ASP.NET Application Types  Two types of Applications:  Web Forms.  XML web services.  Web forms allow us to build form-based web pages .We can use ASP.NET server controls to create common UI elements, and program them for common task.  XML Web services are software applications that use XML to exchange data (information) with other applications on other computers by using Internet protocols.
  • 7. Inside the .NET Framework  : Provides every language running on .NET platform with a base set of Data Types. – Everything in the CTS is an object – Most languages implement aliases to those types – e.g. a four-byte integer value is represented by the CTS type System.Int32 but C# defines an alias for this type called int.  The CLS is a set of rules that a language compiler must follow in order to create .NET applications – The CLS defines the following things Common variable types (called CTS ) Common visibility like when and where can one see these variables, Common method specifications, and so on.
  • 8. Inside the .NET Framework...  Manages the execution of code compiled for the .NET platform. Following Steps occur in CLR: – Managed Code created by VB or C# compilers and converted into . – MSIL contains the and the . – MSIL is kept in a file called along with . – CLR loads and verifies the assembly to make sure that IL is ok. – in CLR converts this IL to machine code. – - Automatic allocation and release of Memory. – allow us to interact with the runtime, & provide additional useful functionality. Provides services and Objects needed to write applications.
  • 10. .NET Tools…the hidden gems ● FusLogVW.exe – Fusion Log Viewer ● NGEN.exe – Native Image Generator ● ILAsm.exe, ILDAsm.exe – IL Assembler and Dis-assembler ● MDA – Managed Debugging Assistants ● SoS.dll
  • 11. Perfmon: What is it? ● The name says it all. ● Used to monitor the performance parameters of the system and the user applications. ● How to use it? ● What are the parameters that we can track?
  • 12. A few .NET Performance Counters ● .NET CLR Memory Counters ● .NET CLR Exceptions ● .NET CLR Loading ● .NET CLR JIT ● Processor ● Memory
  • 13. Scenario I: Application Consuming lot of memory  What should I look at?  # bytes in all Heaps increasing  Indicators: Memory Leak?  # bytes in all Heaps increasing  Gen 2 Heap Size increasing  # GC handles increasing  # total committed/Reserved Bytes increasing  % Time in GC
  • 14. Application Consuming lot of memory.....  Indicators: Memory Fragmentation?  # total reserved Bytes significantly larger than # total committed Bytes  # of Pinned Objects increasing  # GC handles increasing  # bytes in all heaps always increasing
  • 15. Scenario 2: Application throwing lot of exceptions unnecessarily…  Cost of throwing an exception  What else can go wrong?  Blocking exception handlers  Loss of exception context  Perfmon Exception counters to look at:  # of Exceps Thrown  # of Exceps Thrown / Sec  # of Filters / Sec  Throw to Catch Depth / Sec
  • 16. Scenario 3: Application Takes too long time to Load Possible Reasons:  Too many assemblies to load  Too much of jitting happening  Perfmon counters to look at:  % Time in Loading  Current Assemblies  Rate of Assemblies/AppDomains  # of IL Bytes JITted  # of methods JITed  % time in JIT
  • 17. Scenario 4: FileNotFoundException “Our application ran successfully on the Development machine but it is failing with FileNotFoundException when we deploy it in production.” ● Fusion – How the CLR locates assemblies. ● How can the fusion log viewer help us here ● How to look into the Fusion Log ● Fusion Log Viewer: Fuslogvw.exe ● Demo
  • 18. Scenario 5: Slow To Load “Our application takes too long to load for the first time. It exhibits the same behavior once in a while…” ● What happens when a .NET application runs for the first time ● Native Images and how they speed up the loading process ● NGEN: Native image generation ● How NGEN will help us here ● Demo
  • 19. Scenario 6: Memory Leak “My application is consuming lot of memory. It looks like a ‘Memory Leak’ to me…” ● .NET Memory Manager: GC ● How to get managed heap information ● How the CLRProfiler can help us here ● Demo
  • 20. Scenario 7: PInvoke Issues “I used PInvoke to call a native API, I’m doing everything correct, but the call is failing/ the application is failing with AccessViolationException…” ● Crucial to match the native API signature exactly without any exception ● What is MDA ● How MDA will help us here ● Demo
  • 21. Short note on ASP.NET specific counters  Two types:  – System Counters  – Application Counters  Few important Counters:  ASP.NET/Application Restarts.  ASP.NET/Requests Queued  ASP.NET Application/Requests/sec  ASP.NET Application/Errors Total  AND many more…
  • 22. .NET Application Performance  Performance is a relative term:  What is good for you may not be good for others.  Performance Bottlenecks in .NET:  Am I loading too many assemblies at the start?  Am I misusing Exceptions and defeating their purpose ?  Am I doing too many memory operations? Am I trying to deal with the memory management on my own?  The list is long…