SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Introduction to Performance
Optimization of .NET web
apps
About me
 Developer/DevOps at Amilia
 Optimization, scaling, monitoring, SQL Server, Elastic Search
 Editor at InfoQ.com, writing about .NET and F#
 @plmaheu
In this talk
 What does “performance optimization” mean?
 Tools of the trade
 Focused on the server side
What does “performance” means?
 Depends on how it is measured.
 What interest us is response time (measured in ms) and
resource utilisation (CPU, memory, disk, bandwidth)
The method everybody knows:
Guessing
 Tempting to try to optimize code out of a gut feeling
 Unlikely to get it right more than 5-10% of the time
 The possible causes are endless: code, third party library, web
server, CDN, DNS, bandwitdh, ISP, hardware, etc.
Ahmdal’s law
Regardless the magnitude of an improvement, the theoretical speedup of a task is
always limited by the part of the task that cannot benefit from the improvement.
TL;DR: Optimize the right thing.
That SQL query is slow. So what?
Time to optimize
 Measure everything, all the time. Knowing precisely what is slow is key to
efficient performance optimization.
 Stopping profiling too early and fixing the wrong problem is an easy trap
to fall into.
Optimize what?
 Optimizing the the right thing: trickier than it sounds
 Libraries often have overhead on first call (razor view compilation,
scanning an object with reflection, data caching, library caching.
 SQL queries: Parametrized queries, locks, data not in cache
 Tip: Run your request a few times times to get consistent timings.
Not all bottlenecks are created equals
 Different application types lead to different bottlenecks
 Uncommon performance issues in unoptimized code:
 Garbage Collection
 Hitting concurrent request limit, default in asp.net is 12 * cores (async)
 Minor innefficiencies like an extra if condition
Different issues at different scales.
1s Upload a file to third party cloud service
10ms to100ms SQL Queries
1ms Regex match
0,001ms Get a property through reflection
0,000,001ms Multiplying two numbers together
A file upload may look slow, but a thousand SQL queries is slower.
Tooling
Some numbers: Amilia
 2 million pageviews per month
 Between 10 to 20 million requests per month
 Usual throughput : 300 to 500 requests per minute
 During registrations: Anywhere from 1,000 to 12,000 rpm
 SQL: 100,000+ queries per minute in peaks
 Avg. execution time: 100 ms
Note: Static files (js, css, html) are not included, served directly from CDN
Application Performance Monitoring
Provides a clear picture of what’s happening in production.
Data can be used as a starting point to reproduce an issue
locally.
 Stackify Retrace
 New Relic APM
 App Dynamics
 Application Insights
Lightweight code profilers
Provide live performance data on both dev and production systems.
 MiniProfiler
 Glimpse
 Prefix
Example: MiniProfiler
Compared to an optimized page
www.amilia.com/store/en/amilia-customer-
success/shop/programs/17513
Code Profilers
Gives highest degree of details.
Impractical for production, significant overhead.
 Redgate ANTS
 JetBrains dotTrace
Taken with ANTS
I/O: Third-party services and systems must be monitored, even if control over them is limited.
Databases, CDN, payment processor, etc.
Service Map and Database tabs in New Relic
Follow best practices
 Issues can often be avoided by taking a quick look at best practices for a
library
 Difficult and time consuming to find
Examples:
 IIS and HTTPS -> Offload to a load balancer
 NHibernate -> Avoid implicit transactions
 SQL Server -> Too many to name them
To sum it up
 Measure before, during and after changing code
 Optimizing without measuring is like fixing a bug without testing
 Various tools are at your disposal, each giving visibility on some level
 Article with links to the tools: https://www.infoq.com/articles/dotnet-
performance-monitoring-optimization
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
Black Friday and Cyber Monday- Best Practices for Your E-Commerce DatabaseBlack Friday and Cyber Monday- Best Practices for Your E-Commerce Database
Black Friday and Cyber Monday- Best Practices for Your E-Commerce DatabaseTim Vaillancourt
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Brian Brazil
 
Web Application Performance for Business Success
Web Application Performance for Business SuccessWeb Application Performance for Business Success
Web Application Performance for Business SuccessEspeo Software
 
Analyser vos logs avec Ingensi
Analyser vos logs avec IngensiAnalyser vos logs avec Ingensi
Analyser vos logs avec IngensiCyrès
 
Newsweaver - Big Data Storage
Newsweaver - Big Data StorageNewsweaver - Big Data Storage
Newsweaver - Big Data StorageSean Griffin
 
What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)Brian Brazil
 
Combining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observabilityCombining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observabilityElasticsearch
 
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...DevClub_lv
 
Managing a MongoDB Deployment
Managing a MongoDB DeploymentManaging a MongoDB Deployment
Managing a MongoDB DeploymentTony Tam
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDBTony Tam
 
Dana Quinn Velocity Keynote
Dana Quinn Velocity KeynoteDana Quinn Velocity Keynote
Dana Quinn Velocity KeynoteIntuit Inc.
 
Building Big Data Streaming Architectures
Building Big Data Streaming ArchitecturesBuilding Big Data Streaming Architectures
Building Big Data Streaming ArchitecturesDavid Martínez Rego
 
Data flow in the data center
Data flow in the data centerData flow in the data center
Data flow in the data centerAdam Cataldo
 
„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...
„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...
„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...DevClub_lv
 
Cloud Computing, Grid Computing and Docker
Cloud Computing, Grid Computing and DockerCloud Computing, Grid Computing and Docker
Cloud Computing, Grid Computing and Dockersellorm
 
Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...
Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...
Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...Elasticsearch
 
Real time architecture big data
Real time architecture big dataReal time architecture big data
Real time architecture big dataSanjeev Solanki
 
Ansible at FOSDEM (Ansible Dublin, 2016)
Ansible at FOSDEM (Ansible Dublin, 2016)Ansible at FOSDEM (Ansible Dublin, 2016)
Ansible at FOSDEM (Ansible Dublin, 2016)Brian Brazil
 

Was ist angesagt? (20)

Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
Black Friday and Cyber Monday- Best Practices for Your E-Commerce DatabaseBlack Friday and Cyber Monday- Best Practices for Your E-Commerce Database
Black Friday and Cyber Monday- Best Practices for Your E-Commerce Database
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)
 
Web Application Performance for Business Success
Web Application Performance for Business SuccessWeb Application Performance for Business Success
Web Application Performance for Business Success
 
Analyser vos logs avec Ingensi
Analyser vos logs avec IngensiAnalyser vos logs avec Ingensi
Analyser vos logs avec Ingensi
 
Newsweaver - Big Data Storage
Newsweaver - Big Data StorageNewsweaver - Big Data Storage
Newsweaver - Big Data Storage
 
What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)
 
Combining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observabilityCombining logs, metrics, and traces for unified observability
Combining logs, metrics, and traces for unified observability
 
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...“Controlling of messages flow in Microservices architecture” by Andris Lubans...
“Controlling of messages flow in Microservices architecture” by Andris Lubans...
 
Managing a MongoDB Deployment
Managing a MongoDB DeploymentManaging a MongoDB Deployment
Managing a MongoDB Deployment
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDB
 
Keynote
KeynoteKeynote
Keynote
 
Dana Quinn Velocity Keynote
Dana Quinn Velocity KeynoteDana Quinn Velocity Keynote
Dana Quinn Velocity Keynote
 
Building Big Data Streaming Architectures
Building Big Data Streaming ArchitecturesBuilding Big Data Streaming Architectures
Building Big Data Streaming Architectures
 
Data flow in the data center
Data flow in the data centerData flow in the data center
Data flow in the data center
 
„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...
„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...
„OWASP Top Ten in Latvia“ by Agris Krusts from IT Centrs SIA at Security focu...
 
Cloud Computing, Grid Computing and Docker
Cloud Computing, Grid Computing and DockerCloud Computing, Grid Computing and Docker
Cloud Computing, Grid Computing and Docker
 
Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...
Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...
Elastic APM: amplificação dos seus logs e métricas para proporcionar um panor...
 
Prometheus on AWS
Prometheus on AWSPrometheus on AWS
Prometheus on AWS
 
Real time architecture big data
Real time architecture big dataReal time architecture big data
Real time architecture big data
 
Ansible at FOSDEM (Ansible Dublin, 2016)
Ansible at FOSDEM (Ansible Dublin, 2016)Ansible at FOSDEM (Ansible Dublin, 2016)
Ansible at FOSDEM (Ansible Dublin, 2016)
 

Andere mochten auch

How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 
Building responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherBuilding responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherTamir Dresher
 
Monitoring system with Grafana and StatsD
Monitoring system with Grafana and StatsDMonitoring system with Grafana and StatsD
Monitoring system with Grafana and StatsDArtur Prado
 
The Progressive Web and its New Challenges - Confoo Montréal 2017
The Progressive Web and its New Challenges - Confoo Montréal 2017The Progressive Web and its New Challenges - Confoo Montréal 2017
The Progressive Web and its New Challenges - Confoo Montréal 2017Christian Heilmann
 
The Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for HumansThe Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for HumansChristian Heilmann
 
Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...
Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...
Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...jorge arias
 
Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...
Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...
Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...IT Tech
 
The Cliff House Project for Social Media Strategy
The Cliff House Project for Social Media StrategyThe Cliff House Project for Social Media Strategy
The Cliff House Project for Social Media StrategyMichael Cantrall
 
Crystal clear service interfaces w/ Swagger/OpenAPI
Crystal clear service interfaces w/ Swagger/OpenAPICrystal clear service interfaces w/ Swagger/OpenAPI
Crystal clear service interfaces w/ Swagger/OpenAPIScott Triglia
 
Securing MicroServices - ConFoo 2017
Securing MicroServices - ConFoo 2017Securing MicroServices - ConFoo 2017
Securing MicroServices - ConFoo 2017Majid Fatemian
 
Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...
Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...
Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...Dimitar Kostadinov
 
Content That Converts Starts With AUDIENCE
Content That Converts Starts With AUDIENCEContent That Converts Starts With AUDIENCE
Content That Converts Starts With AUDIENCEG3 Communications
 
Business Video Production in 2017 - SEMPDX Engage
Business Video Production in 2017 - SEMPDX Engage Business Video Production in 2017 - SEMPDX Engage
Business Video Production in 2017 - SEMPDX Engage Phil Nottingham
 
DroidKaigi 2017 welcometalk DAY01
DroidKaigi 2017 welcometalk DAY01DroidKaigi 2017 welcometalk DAY01
DroidKaigi 2017 welcometalk DAY01Masahiro Hidaka
 
Accessible & Usable Web Forms. Your How To Guide!
Accessible & Usable Web Forms. Your How To Guide!Accessible & Usable Web Forms. Your How To Guide!
Accessible & Usable Web Forms. Your How To Guide!Rabab Gomaa
 
DroidKaigi 2017 welcometalk DAY02
DroidKaigi 2017 welcometalk DAY02DroidKaigi 2017 welcometalk DAY02
DroidKaigi 2017 welcometalk DAY02Masahiro Hidaka
 
‘Everything Available’ – a vision for the development of the British Library ...
‘Everything Available’ – a vision for the development of the British Library ...‘Everything Available’ – a vision for the development of the British Library ...
‘Everything Available’ – a vision for the development of the British Library ...Torsten Reimer
 
15 ways to take control of your time at work
15 ways to take control of your time at work 15 ways to take control of your time at work
15 ways to take control of your time at work ProofHub
 

Andere mochten auch (20)

How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Building responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresherBuilding responsive application with Rx - confoo - tamir dresher
Building responsive application with Rx - confoo - tamir dresher
 
Monitoring system with Grafana and StatsD
Monitoring system with Grafana and StatsDMonitoring system with Grafana and StatsD
Monitoring system with Grafana and StatsD
 
The Progressive Web and its New Challenges - Confoo Montréal 2017
The Progressive Web and its New Challenges - Confoo Montréal 2017The Progressive Web and its New Challenges - Confoo Montréal 2017
The Progressive Web and its New Challenges - Confoo Montréal 2017
 
The Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for HumansThe Soul in The Machine - Developing for Humans
The Soul in The Machine - Developing for Humans
 
Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...
Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...
Actividad de aprendizaje unidad 3 requisitos e interpretacion de la norma iso...
 
Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...
Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...
Cisco asa 5500 x series migration options-asa 5555-x, asa 5525-x & asa 55...
 
The Cliff House Project for Social Media Strategy
The Cliff House Project for Social Media StrategyThe Cliff House Project for Social Media Strategy
The Cliff House Project for Social Media Strategy
 
Crystal clear service interfaces w/ Swagger/OpenAPI
Crystal clear service interfaces w/ Swagger/OpenAPICrystal clear service interfaces w/ Swagger/OpenAPI
Crystal clear service interfaces w/ Swagger/OpenAPI
 
Securing MicroServices - ConFoo 2017
Securing MicroServices - ConFoo 2017Securing MicroServices - ConFoo 2017
Securing MicroServices - ConFoo 2017
 
Microservices
MicroservicesMicroservices
Microservices
 
Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...
Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...
Recoalsa Reciclados - Empresa Recuperación Placas electrónicas Alaquas Fallas...
 
Content That Converts Starts With AUDIENCE
Content That Converts Starts With AUDIENCEContent That Converts Starts With AUDIENCE
Content That Converts Starts With AUDIENCE
 
Donantes vivos.
Donantes vivos.Donantes vivos.
Donantes vivos.
 
Business Video Production in 2017 - SEMPDX Engage
Business Video Production in 2017 - SEMPDX Engage Business Video Production in 2017 - SEMPDX Engage
Business Video Production in 2017 - SEMPDX Engage
 
DroidKaigi 2017 welcometalk DAY01
DroidKaigi 2017 welcometalk DAY01DroidKaigi 2017 welcometalk DAY01
DroidKaigi 2017 welcometalk DAY01
 
Accessible & Usable Web Forms. Your How To Guide!
Accessible & Usable Web Forms. Your How To Guide!Accessible & Usable Web Forms. Your How To Guide!
Accessible & Usable Web Forms. Your How To Guide!
 
DroidKaigi 2017 welcometalk DAY02
DroidKaigi 2017 welcometalk DAY02DroidKaigi 2017 welcometalk DAY02
DroidKaigi 2017 welcometalk DAY02
 
‘Everything Available’ – a vision for the development of the British Library ...
‘Everything Available’ – a vision for the development of the British Library ...‘Everything Available’ – a vision for the development of the British Library ...
‘Everything Available’ – a vision for the development of the British Library ...
 
15 ways to take control of your time at work
15 ways to take control of your time at work 15 ways to take control of your time at work
15 ways to take control of your time at work
 

Ähnlich wie ConFoo 2017: Introduction to performance optimization of .NET web apps

Operations: Production Readiness Review – How to stop bad things from Happening
Operations: Production Readiness Review – How to stop bad things from HappeningOperations: Production Readiness Review – How to stop bad things from Happening
Operations: Production Readiness Review – How to stop bad things from HappeningAmazon Web Services
 
The Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web ServiceThe Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web ServicePoornima Vijayashanker
 
Natural Laws of Software Performance
Natural Laws of Software PerformanceNatural Laws of Software Performance
Natural Laws of Software PerformanceGibraltar Software
 
Start Up Austin 2017: Production Preview - How to Stop Bad Things From Happening
Start Up Austin 2017: Production Preview - How to Stop Bad Things From HappeningStart Up Austin 2017: Production Preview - How to Stop Bad Things From Happening
Start Up Austin 2017: Production Preview - How to Stop Bad Things From HappeningAmazon Web Services
 
"Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada Fwdays
 
Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...
Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...
Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...stevemcpherson
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsDirecti Group
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysqlliufabin 66688
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
Operations: Production Readiness
Operations: Production ReadinessOperations: Production Readiness
Operations: Production ReadinessAmazon Web Services
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Prolifics
 
Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019Pierre-Luc Maheu
 
UnConference for Georgia Southern Computer Science March 31, 2015
UnConference for Georgia Southern Computer Science March 31, 2015UnConference for Georgia Southern Computer Science March 31, 2015
UnConference for Georgia Southern Computer Science March 31, 2015Christopher Curtin
 
MongoDB and In-Memory Computing
MongoDB and In-Memory ComputingMongoDB and In-Memory Computing
MongoDB and In-Memory ComputingDylan Tong
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDogRedis Labs
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon RedshiftAmazon Web Services
 
PHP Performance: Principles and tools
PHP Performance: Principles and toolsPHP Performance: Principles and tools
PHP Performance: Principles and tools10n Software, LLC
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And ScalabilityJason Ragsdale
 

Ähnlich wie ConFoo 2017: Introduction to performance optimization of .NET web apps (20)

Operations: Production Readiness Review – How to stop bad things from Happening
Operations: Production Readiness Review – How to stop bad things from HappeningOperations: Production Readiness Review – How to stop bad things from Happening
Operations: Production Readiness Review – How to stop bad things from Happening
 
The Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web ServiceThe Evolution of a Scrappy Startup to a Successful Web Service
The Evolution of a Scrappy Startup to a Successful Web Service
 
Natural Laws of Software Performance
Natural Laws of Software PerformanceNatural Laws of Software Performance
Natural Laws of Software Performance
 
Start Up Austin 2017: Production Preview - How to Stop Bad Things From Happening
Start Up Austin 2017: Production Preview - How to Stop Bad Things From HappeningStart Up Austin 2017: Production Preview - How to Stop Bad Things From Happening
Start Up Austin 2017: Production Preview - How to Stop Bad Things From Happening
 
"Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
 
Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...
Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...
Anurag Gupta's talk on DevOps at AWS. Nov 17 at the Palo Alto AWS Big Data Me...
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale Systems
 
High Performance Mysql
High Performance MysqlHigh Performance Mysql
High Performance Mysql
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Operations: Production Readiness
Operations: Production ReadinessOperations: Production Readiness
Operations: Production Readiness
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
 
Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019Performance Optimization in Large Systems - Cusec 2019
Performance Optimization in Large Systems - Cusec 2019
 
UnConference for Georgia Southern Computer Science March 31, 2015
UnConference for Georgia Southern Computer Science March 31, 2015UnConference for Georgia Southern Computer Science March 31, 2015
UnConference for Georgia Southern Computer Science March 31, 2015
 
MongoDB and In-Memory Computing
MongoDB and In-Memory ComputingMongoDB and In-Memory Computing
MongoDB and In-Memory Computing
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
PHP Performance: Principles and tools
PHP Performance: Principles and toolsPHP Performance: Principles and tools
PHP Performance: Principles and tools
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 

Kürzlich hochgeladen

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 

Kürzlich hochgeladen (20)

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

ConFoo 2017: Introduction to performance optimization of .NET web apps

  • 2. About me  Developer/DevOps at Amilia  Optimization, scaling, monitoring, SQL Server, Elastic Search  Editor at InfoQ.com, writing about .NET and F#  @plmaheu
  • 3. In this talk  What does “performance optimization” mean?  Tools of the trade  Focused on the server side
  • 4. What does “performance” means?  Depends on how it is measured.  What interest us is response time (measured in ms) and resource utilisation (CPU, memory, disk, bandwidth)
  • 5. The method everybody knows: Guessing  Tempting to try to optimize code out of a gut feeling  Unlikely to get it right more than 5-10% of the time  The possible causes are endless: code, third party library, web server, CDN, DNS, bandwitdh, ISP, hardware, etc.
  • 6. Ahmdal’s law Regardless the magnitude of an improvement, the theoretical speedup of a task is always limited by the part of the task that cannot benefit from the improvement. TL;DR: Optimize the right thing.
  • 7. That SQL query is slow. So what?
  • 8. Time to optimize  Measure everything, all the time. Knowing precisely what is slow is key to efficient performance optimization.  Stopping profiling too early and fixing the wrong problem is an easy trap to fall into.
  • 9. Optimize what?  Optimizing the the right thing: trickier than it sounds  Libraries often have overhead on first call (razor view compilation, scanning an object with reflection, data caching, library caching.  SQL queries: Parametrized queries, locks, data not in cache  Tip: Run your request a few times times to get consistent timings.
  • 10. Not all bottlenecks are created equals  Different application types lead to different bottlenecks  Uncommon performance issues in unoptimized code:  Garbage Collection  Hitting concurrent request limit, default in asp.net is 12 * cores (async)  Minor innefficiencies like an extra if condition
  • 11. Different issues at different scales. 1s Upload a file to third party cloud service 10ms to100ms SQL Queries 1ms Regex match 0,001ms Get a property through reflection 0,000,001ms Multiplying two numbers together A file upload may look slow, but a thousand SQL queries is slower.
  • 13. Some numbers: Amilia  2 million pageviews per month  Between 10 to 20 million requests per month  Usual throughput : 300 to 500 requests per minute  During registrations: Anywhere from 1,000 to 12,000 rpm  SQL: 100,000+ queries per minute in peaks  Avg. execution time: 100 ms Note: Static files (js, css, html) are not included, served directly from CDN
  • 14. Application Performance Monitoring Provides a clear picture of what’s happening in production. Data can be used as a starting point to reproduce an issue locally.  Stackify Retrace  New Relic APM  App Dynamics  Application Insights
  • 15.
  • 16. Lightweight code profilers Provide live performance data on both dev and production systems.  MiniProfiler  Glimpse  Prefix
  • 18. Compared to an optimized page www.amilia.com/store/en/amilia-customer- success/shop/programs/17513
  • 19. Code Profilers Gives highest degree of details. Impractical for production, significant overhead.  Redgate ANTS  JetBrains dotTrace
  • 21. I/O: Third-party services and systems must be monitored, even if control over them is limited. Databases, CDN, payment processor, etc. Service Map and Database tabs in New Relic
  • 22. Follow best practices  Issues can often be avoided by taking a quick look at best practices for a library  Difficult and time consuming to find Examples:  IIS and HTTPS -> Offload to a load balancer  NHibernate -> Avoid implicit transactions  SQL Server -> Too many to name them
  • 23. To sum it up  Measure before, during and after changing code  Optimizing without measuring is like fixing a bug without testing  Various tools are at your disposal, each giving visibility on some level  Article with links to the tools: https://www.infoq.com/articles/dotnet- performance-monitoring-optimization

Hinweis der Redaktion

  1. Each environnement is different, this presentation being .NET is focused on the server side. Front-end has its own set of tools and challenges. A performance issue usually have multiple possible solutions, can’t make a choice without context.
  2. Memory footprint, latency, time to see a result, amount of hardware required
  3. Any small detail can make all the difference.
  4. Total : 10 seconds. Even if the query was completely removed, max improvement is 1%. No measurements, no way to know if optimization is worthwhile
  5. MiniProfiler and Glimpse -> Configuration Prefix -> Installed, works with profiler APIs