SlideShare a Scribd company logo
Performance on a
         Budget
    Dimitry Ushakov
       June 9, 2012
Austin Code Camp 2012
  Sponsors
Overview
   What is Performance?
   Why Performance?
   How to Measure Performance?
   Improving Performance
   Tools
   Best Practices
What is Performance?
   3 parts of performance
        Speed
            How quickly application responds to a user
        Scalability
            How application handles expected users and
             beyond
        Stability
            How stable the application is under load
                Could be expected or unexpected
Why Performance?
Slowdown Of 1 Second Costs $1.6 Billion
How to Measure Performance
   •   Live Single user execution
       •   How quickly the application responds
           throughout the full application call
   •   Automated unit and integration testing
   •   Multi-user performance testing
       •   Load testing
       •   Stress testing
       •   Peak testing
       •   Duration testing
       •   Failover testing
Improving Performance



   80-90% of the end-user response time is spent
     on the frontend. Start there
                    - Steve Souders
Front End – Asset Size
    Compress assets
    • GZIP (all but PNG)
      •   http://zoompf.com/blog/2012/02/lose-the-wait-
          httpcompression
    Minify JS & CSS
    Don’t overload asset contents
Front End – Client Rendering
    Excess DOM
    Understand JS events
    DOM manipulation
    Fonts
    Avoid repaints and reflows
    Cache JS

    References:
    •   http://perfectionkills.com/profiling-css-for-fun-and-
        profit-optimization-notes/
    •   http://blog.monitor.us/2012/03/27-website-
        performance-javascript/
Front End – Progressive
Enhancement
   Chunked encoding
   •   ASP.NET doesn’t chunk by default
   •   If you turn it on and writeln to response, each write will get
       chunked (big perf hit for large HTML)
   AJAX
   Defer JS
   CSS on top
   JS on the bottom
   JS load asynchronously
Latency
   Use CDNs
   Caching
   • 35% reduction in bandwidth
   Combine JS and CSS files
   Load JS asynchronously
   Sprites
   Inline images
   Prefetch and cache assets for future use
Tools for Frontend Measurement
 Grading Tools      Profiling          Timing
 PageSpeed          SpeedTracer        Blaze.io
 -can be a plugin   -Chrome add-on     -mobile timing
 -can be a CDN
 Yslow!             Web developer     Webpagetest
 -add-on            tools             -can select location and enter URL
 -runs locally      (Chrome/IE/Firefo -mobile section uses Blaze.IO
                    x)
                    Firebug            PCAP Web Performance Analyzer
                                       -uses hars/pcaps to analyze
                                       webpages
                                       Loads.in
                                       -tests how long page loads from
                                       various locations
Tools for Performance analysis
    Analytics              Network Analyzer           APIs
    Google analytics       Fiddler                    Navigation timing
                                                      ((http://www.w3.org/T
                                                      R/navigation-timing/)
                                                      -shows all parts of
                                                      network in page load
                                                      -doesn’t split by
                                                      resource (future)
    Statsd                 Wireshark (not free)       Boomerang.js
    -nodejs library that                              -measures network
    collects stats                                    traffic
                           Tcpdump
                           -logs tcp calls to a url
                           cUrl
                           -web crawler
                           Dig
                           -investigates DNS
Tools for Content Delivery
    JSON deliver                    CDN
    Jdrop                           CloudFlare
    -Store JSON data in the cloud



                                    CloudFront
                                    PageSpeed
Tools for Testing
    Performance Testing                     Code analysis
    Blitz.io                                Benchmark.js
    -ability to run up to 250 users in 60   -framework for measuring method
    seconds for free.                       response times
    -can be automated (use in
    continuous integration)


                                            Browsermob-proxy
                                            -captures har data from tests
                                            during functional tests
                                            Css-stress
                                            -profiles css stylesheets
Tools for Mobile Optimizations
    Images                              Font
    src.sencha.io                       FontSquirrel
    -resizes the image to fit the       -generates font that’s best for your
    physical screen (mobile)            device
    Imagealpha
    -converts 24-bit PNG to 8-bit PNG
    (mobile)
Backend - SOA
   •   Rely on service oriented architecture
   •   Separate your data
       •   Transactional vs. reporting
   •   Separate I/O and CPU bound processes on
       different machines
   •   Utilize event sourcing patterns
   •   Concurrent operations
       •   Be careful!
   •   Eventual Consistency
Backend - Cache
   •   Cache as much as you can
       •   But not too much!
   •   Use the right caching tool
   •   Understand different caching patterns
       •   Primed Cache
       •   Demand Cache
   •   Take advantage of ASP.NET Caching
Backend - DB
   •   Long running queries
   •   Write/write conflicts
   •   Large joins
   •   indexes
Backend
   •   BIGGEST PROBLEM  CONTEXT SWITCHING
   •   Measure GC pauses
   •   Optimize worker threads
   •   Thread deadlocks
   •   Be careful of Large object fragmentation
   •   Be careful of Object Relational Mappings
   •   Don’t rely on Exceptions for logic
   •   Utilize Connection Pooling
       •   Threads
       •   DB
   •   Utilize Batch requests and responses
   •   Understand operation impact on .NET Performance
   •   Take advantage of memory utilization
Tools for Profiling
    Web profiling   Instrumented profiling
    Glimpse         ANTS Performance Profiler ($499)
    Mini-profiler   JetBrains dotTrace ($399)
                    -can integrate with ReSharper
                    dynaTrace (varies)
                    -can be integrated with CI
                    -can do monitoring/profiling/diagnostics and much
                    more
                    -most expensive
                    VS2010 Profiler
                    -offered in Visual Studio
Tools for Profiling
    Heap profiler   Benchmarking
    PerfView        MeasureIt
    PerfMon


    Comparison   for APM and BTM tools
    (http://www.scribd.com/doc/53541961/Competitive-
    Analysis-Application-Performance-Management-and-
    Business)
        Goes over a set of tools (none are free and most are
        enterprise) for monitoring and transaction tracing
Best Practices - SDLC
                              Requirements

                       Establish performance goals


                               Architecture

     Document performance metrics                Document SLAs


                              Development

         Profiling             Prototyping           Continuous Integration


                                    Testing

                           Performance testing
Best Practices – What to test
    •   Critical business transactions
    •   Frequently used transactions
    •   Performance-intensive transactions
Best Practices - notes
    •   DO NOT prematurely optimize
    •   DO start with 3rd party tools but roll your own
        solutions if necessary for performance
    •   DO NOT be afraid to modify standard
        solutions
    •   DO go for the first bottleneck and always
        retest after
        •   Follow “test  fix  retest” pattern
Contact

                    @dimtruck
          Dimitry.ushakov@accenture.com


    http://dimitryushakov.com/codecamp2012/pres
                         entation
   • Will have slides of the presentation and
      references
Ad

More Related Content

Viewers also liked (9)

Earned Value
Earned ValueEarned Value
Earned Value
ahmad bassiouny
 
Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...
Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...
Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...
Scott Marshall
 
Training matrix for 2014 inset
Training matrix for 2014 insetTraining matrix for 2014 inset
Training matrix for 2014 inset
doting_2014bantilan
 
Presentation on budget for training of personnels of regional ceentres
Presentation on budget for training of personnels of regional ceentresPresentation on budget for training of personnels of regional ceentres
Presentation on budget for training of personnels of regional ceentres
Mukut Deori
 
Copq benefits of correct measurement (for slideshare)
Copq   benefits of correct measurement (for slideshare)Copq   benefits of correct measurement (for slideshare)
Copq benefits of correct measurement (for slideshare)
Imran Jamil
 
Project work plan and budget matrix gulayan 2016
Project work plan and budget matrix  gulayan 2016Project work plan and budget matrix  gulayan 2016
Project work plan and budget matrix gulayan 2016
LemardeGuia
 
The Perils of Performance Measurement
The Perils of Performance MeasurementThe Perils of Performance Measurement
The Perils of Performance Measurement
Olivier Serrat
 
Aligning Performance Levers for Breakthrough Sales Results 08-2011
Aligning Performance Levers for Breakthrough Sales Results 08-2011Aligning Performance Levers for Breakthrough Sales Results 08-2011
Aligning Performance Levers for Breakthrough Sales Results 08-2011
Mike Kunkle
 
Developing Metrics and KPI (Key Performance Indicators
Developing Metrics and KPI (Key Performance IndicatorsDeveloping Metrics and KPI (Key Performance Indicators
Developing Metrics and KPI (Key Performance Indicators
Victor Holman
 
Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...
Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...
Aligning Enrollment Management with Performance-Based Budget Planning, Marsha...
Scott Marshall
 
Presentation on budget for training of personnels of regional ceentres
Presentation on budget for training of personnels of regional ceentresPresentation on budget for training of personnels of regional ceentres
Presentation on budget for training of personnels of regional ceentres
Mukut Deori
 
Copq benefits of correct measurement (for slideshare)
Copq   benefits of correct measurement (for slideshare)Copq   benefits of correct measurement (for slideshare)
Copq benefits of correct measurement (for slideshare)
Imran Jamil
 
Project work plan and budget matrix gulayan 2016
Project work plan and budget matrix  gulayan 2016Project work plan and budget matrix  gulayan 2016
Project work plan and budget matrix gulayan 2016
LemardeGuia
 
The Perils of Performance Measurement
The Perils of Performance MeasurementThe Perils of Performance Measurement
The Perils of Performance Measurement
Olivier Serrat
 
Aligning Performance Levers for Breakthrough Sales Results 08-2011
Aligning Performance Levers for Breakthrough Sales Results 08-2011Aligning Performance Levers for Breakthrough Sales Results 08-2011
Aligning Performance Levers for Breakthrough Sales Results 08-2011
Mike Kunkle
 
Developing Metrics and KPI (Key Performance Indicators
Developing Metrics and KPI (Key Performance IndicatorsDeveloping Metrics and KPI (Key Performance Indicators
Developing Metrics and KPI (Key Performance Indicators
Victor Holman
 

Similar to Performance on a budget (20)

Performance testing in scope of migration to cloud by Serghei Radov
Performance testing in scope of migration to cloud by Serghei RadovPerformance testing in scope of migration to cloud by Serghei Radov
Performance testing in scope of migration to cloud by Serghei Radov
Valeriia Maliarenko
 
Load testing and performance tracing
Load testing and performance tracingLoad testing and performance tracing
Load testing and performance tracing
Hans Höchtl
 
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
Adrian Cockcroft
 
OTM Performance Review and Benchmarking
OTM Performance Review and BenchmarkingOTM Performance Review and Benchmarking
OTM Performance Review and Benchmarking
MavenWire
 
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
Ram G Athreya
 
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
Agile Testing Alliance
 
Tool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanelTool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanel
toolitup
 
Salesforce Performance hacks - Client Side
Salesforce Performance hacks - Client SideSalesforce Performance hacks - Client Side
Salesforce Performance hacks - Client Side
Paris Salesforce Developer Group
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
fakeaccount225095
 
Common Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the CloudCommon Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the Cloud
Nick Gerner
 
How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...
PerformanceVision (previously SecurActive)
 
Capacity Planning
Capacity PlanningCapacity Planning
Capacity Planning
MongoDB
 
Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)
Andrew Rota
 
On-boarding with JanusGraph Performance
On-boarding with JanusGraph PerformanceOn-boarding with JanusGraph Performance
On-boarding with JanusGraph Performance
Chin Huang
 
Latest trends in information technology
Latest trends in information technologyLatest trends in information technology
Latest trends in information technology
Eldos Kuriakose
 
DW on AWS
DW on AWSDW on AWS
DW on AWS
Gaurav Agrawal
 
Spark Development Lifecycle at Workday - ApacheCon 2020
Spark Development Lifecycle at Workday - ApacheCon 2020Spark Development Lifecycle at Workday - ApacheCon 2020
Spark Development Lifecycle at Workday - ApacheCon 2020
Pavel Hardak
 
Apache Spark Development Lifecycle @ Workday - ApacheCon 2020
Apache Spark Development Lifecycle @ Workday - ApacheCon 2020Apache Spark Development Lifecycle @ Workday - ApacheCon 2020
Apache Spark Development Lifecycle @ Workday - ApacheCon 2020
Eren Avşaroğulları
 
L19 Application Architecture
L19 Application ArchitectureL19 Application Architecture
L19 Application Architecture
Ólafur Andri Ragnarsson
 
Know More About Rational Performance - Snehamoy K
Know More About Rational Performance - Snehamoy KKnow More About Rational Performance - Snehamoy K
Know More About Rational Performance - Snehamoy K
Roopa Nadkarni
 
Performance testing in scope of migration to cloud by Serghei Radov
Performance testing in scope of migration to cloud by Serghei RadovPerformance testing in scope of migration to cloud by Serghei Radov
Performance testing in scope of migration to cloud by Serghei Radov
Valeriia Maliarenko
 
Load testing and performance tracing
Load testing and performance tracingLoad testing and performance tracing
Load testing and performance tracing
Hans Höchtl
 
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
CMG2013 Workshop: Netflix Cloud Native, Capacity, Performance and Cost Optimi...
Adrian Cockcroft
 
OTM Performance Review and Benchmarking
OTM Performance Review and BenchmarkingOTM Performance Review and Benchmarking
OTM Performance Review and Benchmarking
MavenWire
 
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
Ram G Athreya
 
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
ATAGTR2017 Unified APM: The new age performance monitoring for production sys...
Agile Testing Alliance
 
Tool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanelTool it Up! - Session #2 - NetPanel
Tool it Up! - Session #2 - NetPanel
toolitup
 
Common Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the CloudCommon Sense Performance Indicators in the Cloud
Common Sense Performance Indicators in the Cloud
Nick Gerner
 
How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...
PerformanceVision (previously SecurActive)
 
Capacity Planning
Capacity PlanningCapacity Planning
Capacity Planning
MongoDB
 
Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)Client-Side Performance Monitoring (MobileTea, Rome)
Client-Side Performance Monitoring (MobileTea, Rome)
Andrew Rota
 
On-boarding with JanusGraph Performance
On-boarding with JanusGraph PerformanceOn-boarding with JanusGraph Performance
On-boarding with JanusGraph Performance
Chin Huang
 
Latest trends in information technology
Latest trends in information technologyLatest trends in information technology
Latest trends in information technology
Eldos Kuriakose
 
Spark Development Lifecycle at Workday - ApacheCon 2020
Spark Development Lifecycle at Workday - ApacheCon 2020Spark Development Lifecycle at Workday - ApacheCon 2020
Spark Development Lifecycle at Workday - ApacheCon 2020
Pavel Hardak
 
Apache Spark Development Lifecycle @ Workday - ApacheCon 2020
Apache Spark Development Lifecycle @ Workday - ApacheCon 2020Apache Spark Development Lifecycle @ Workday - ApacheCon 2020
Apache Spark Development Lifecycle @ Workday - ApacheCon 2020
Eren Avşaroğulları
 
Know More About Rational Performance - Snehamoy K
Know More About Rational Performance - Snehamoy KKnow More About Rational Performance - Snehamoy K
Know More About Rational Performance - Snehamoy K
Roopa Nadkarni
 
Ad

Recently uploaded (20)

Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Ad

Performance on a budget

  • 1. Performance on a Budget Dimitry Ushakov June 9, 2012
  • 2. Austin Code Camp 2012 Sponsors
  • 3. Overview What is Performance? Why Performance? How to Measure Performance? Improving Performance Tools Best Practices
  • 4. What is Performance? 3 parts of performance  Speed  How quickly application responds to a user  Scalability  How application handles expected users and beyond  Stability  How stable the application is under load  Could be expected or unexpected
  • 6. Slowdown Of 1 Second Costs $1.6 Billion
  • 7. How to Measure Performance • Live Single user execution • How quickly the application responds throughout the full application call • Automated unit and integration testing • Multi-user performance testing • Load testing • Stress testing • Peak testing • Duration testing • Failover testing
  • 8. Improving Performance 80-90% of the end-user response time is spent on the frontend. Start there - Steve Souders
  • 9. Front End – Asset Size Compress assets • GZIP (all but PNG) • http://zoompf.com/blog/2012/02/lose-the-wait- httpcompression Minify JS & CSS Don’t overload asset contents
  • 10. Front End – Client Rendering Excess DOM Understand JS events DOM manipulation Fonts Avoid repaints and reflows Cache JS References: • http://perfectionkills.com/profiling-css-for-fun-and- profit-optimization-notes/ • http://blog.monitor.us/2012/03/27-website- performance-javascript/
  • 11. Front End – Progressive Enhancement Chunked encoding • ASP.NET doesn’t chunk by default • If you turn it on and writeln to response, each write will get chunked (big perf hit for large HTML) AJAX Defer JS CSS on top JS on the bottom JS load asynchronously
  • 12. Latency Use CDNs Caching • 35% reduction in bandwidth Combine JS and CSS files Load JS asynchronously Sprites Inline images Prefetch and cache assets for future use
  • 13. Tools for Frontend Measurement Grading Tools Profiling Timing PageSpeed SpeedTracer Blaze.io -can be a plugin -Chrome add-on -mobile timing -can be a CDN Yslow! Web developer Webpagetest -add-on tools -can select location and enter URL -runs locally (Chrome/IE/Firefo -mobile section uses Blaze.IO x) Firebug PCAP Web Performance Analyzer -uses hars/pcaps to analyze webpages Loads.in -tests how long page loads from various locations
  • 14. Tools for Performance analysis Analytics Network Analyzer APIs Google analytics Fiddler Navigation timing ((http://www.w3.org/T R/navigation-timing/) -shows all parts of network in page load -doesn’t split by resource (future) Statsd Wireshark (not free) Boomerang.js -nodejs library that -measures network collects stats traffic Tcpdump -logs tcp calls to a url cUrl -web crawler Dig -investigates DNS
  • 15. Tools for Content Delivery JSON deliver CDN Jdrop CloudFlare -Store JSON data in the cloud CloudFront PageSpeed
  • 16. Tools for Testing Performance Testing Code analysis Blitz.io Benchmark.js -ability to run up to 250 users in 60 -framework for measuring method seconds for free. response times -can be automated (use in continuous integration) Browsermob-proxy -captures har data from tests during functional tests Css-stress -profiles css stylesheets
  • 17. Tools for Mobile Optimizations Images Font src.sencha.io FontSquirrel -resizes the image to fit the -generates font that’s best for your physical screen (mobile) device Imagealpha -converts 24-bit PNG to 8-bit PNG (mobile)
  • 18. Backend - SOA • Rely on service oriented architecture • Separate your data • Transactional vs. reporting • Separate I/O and CPU bound processes on different machines • Utilize event sourcing patterns • Concurrent operations • Be careful! • Eventual Consistency
  • 19. Backend - Cache • Cache as much as you can • But not too much! • Use the right caching tool • Understand different caching patterns • Primed Cache • Demand Cache • Take advantage of ASP.NET Caching
  • 20. Backend - DB • Long running queries • Write/write conflicts • Large joins • indexes
  • 21. Backend • BIGGEST PROBLEM  CONTEXT SWITCHING • Measure GC pauses • Optimize worker threads • Thread deadlocks • Be careful of Large object fragmentation • Be careful of Object Relational Mappings • Don’t rely on Exceptions for logic • Utilize Connection Pooling • Threads • DB • Utilize Batch requests and responses • Understand operation impact on .NET Performance • Take advantage of memory utilization
  • 22. Tools for Profiling Web profiling Instrumented profiling Glimpse ANTS Performance Profiler ($499) Mini-profiler JetBrains dotTrace ($399) -can integrate with ReSharper dynaTrace (varies) -can be integrated with CI -can do monitoring/profiling/diagnostics and much more -most expensive VS2010 Profiler -offered in Visual Studio
  • 23. Tools for Profiling Heap profiler Benchmarking PerfView MeasureIt PerfMon Comparison for APM and BTM tools (http://www.scribd.com/doc/53541961/Competitive- Analysis-Application-Performance-Management-and- Business) Goes over a set of tools (none are free and most are enterprise) for monitoring and transaction tracing
  • 24. Best Practices - SDLC Requirements Establish performance goals Architecture Document performance metrics Document SLAs Development Profiling Prototyping Continuous Integration Testing Performance testing
  • 25. Best Practices – What to test • Critical business transactions • Frequently used transactions • Performance-intensive transactions
  • 26. Best Practices - notes • DO NOT prematurely optimize • DO start with 3rd party tools but roll your own solutions if necessary for performance • DO NOT be afraid to modify standard solutions • DO go for the first bottleneck and always retest after • Follow “test  fix  retest” pattern
  • 27. Contact @dimtruck [email protected] http://dimitryushakov.com/codecamp2012/pres entation • Will have slides of the presentation and references

Editor's Notes

  • #5: 2 minutes (4 total)-quickly cover what you mean by performance. Performance could mean different things to different people.
  • #6: 3 minutes (7 minutes)
  • #8: 4 minutes (11 minutes)Quickly go through different types of testingLive profilingAutomated testingIncludes unit tests (Nunit)Includes integration tests (Selenium)Load testingLoad  regular load testingStress  keep increasing number of users until it breaksPeak  test against peak loadBreak  kill various parts of the applications and monitor user experienceFailover  if you have multiple data centers/kill the data center and test againSTART DEMO HEREGo over what it is: facebook for DOGSRun through the applicationPoint out slowness in loading imagesPoint out slowness in loading entire pagePoint out how going back to the page does not help
  • #9: 97% of mobile and 85% of desktop is spent on frontend
  • #10: Measure with waterfall (SHOW EXAMPLE) - know the differences (http://www.stevesouders.com/blog/2011/08/26/waterfall-ui-conventions/)GZIP  improves by 13-25%unavailable in some old browsersAsset size-don’t download unnecessary information (extra css and js)-excess dom-don’t download and hide content-don’t download and shrink content-minify js and cssCAVEAT: mobile pattern:-embed JS and CSS in the first response. save JS and CSS to localStorage on phone, then subsequent requests would only load those files that are needed based on cookie [set with stored js/css].  -More work needed to figure out which page to return but still faster.-caveat on caveat localStorage read is MUCH SLOWER than object read since it’s disk read [data size stored does not matter per key] (http://calendar.perfplanet.com/2011/localstorage-read-performance/)SHOW DEMO (STEP 1):Turn on GZIPUse minified files
  • #11: Optimize client rendering-optimize images with css sprites, gradients and incline images-use jsperf to compare different functions-understand dom behavior for different events-e.g. understand difference between bubbling and capturing events-avoid reflows (DOM manipulation, layout change, window resizing, table manipulation, absolute/fixed better than static/relative position, font change, stylesheet add/remove)-avoid repaints (add outline, change visibility, change bg color)-DOM manipulation -- add subtrees to dom tree at once-clean up objects after you’re done (delete key)-primitive operators over function callsFONTS- Host the fonts on a CDN- GZIP all except .woff (already compressed)- Cache all font files for 30+ days- Remove excess glyphs (characters) from the font files- Ensure @font-face is the first rule of the first stylesheet on the page (IE)- Load through javascript (http://www.artzstudio.com/2012/02/web-font-performance-weighing-fontface-options-and-alternatives/)SHOW DEMO:-remove bad fonts and update through tool-remove unnecessary repaints and reflows
  • #12: Progressive Enhancement-deliver HTML first and quickly (chunked encoding)-load visible content first-defer JS until the end-decorate after everything is loaded-use controlJSfile for async loading http://stevesouders.com/controljs/-media queries-Synchronous scripts block all following elements from rendering- insertBefore (async) vs. script tag (sync)- async- xhreval (bad), xhr injection, script in iframe, script dom element, script defer, document.write- use anywhere.js/bootstrap.js to ansynchronously load third-party libraries for JS with dependenciesSHOW DEMO (STEP 2):-put css on top-put js on the bottom
  • #13: 3 minutes (24 minutes)-TCP slow start - to control congestion inside the network- server starts by sending a few packets, waits for acknowledgement and then increases the # subsequentlyTalk about latency fluctuations-65-145ms on desktop vs up to 900ms on mobileMobile-Wireless provider slowdown-Android closes TCP sockets after 6 secs of inactivity-3g device establishes radio link to carrier’s cell tower (consumes battery)takes 1-2 seconds to connect to cell towerSteve Souders wrote about these findings  http://www.stevesouders.com/blog/2011/09/21/making-a-mobile-connection/CDN-Japan is the fastest growing mobile commerce (Rakuten's Online Commerce Revenue, Desktop vs Mobile)-Cloudfront from Amazon (doesn’t do gzip out of the box)-Cloudflare (free service)No redirects-redirecting on mobile are expensive (due to latency)Avoid css importsDon’t download the same asset twice (especially if not cached)Prefetch-predownload necessary assets before they’re requiredCaching -adding Expires Header-35% reduction in bandwidthWork around TCP slow startDropped packetsDNS lookupshttp://www.websiteoptimization.com/speed/tweak/inline-images/SHOW DEMO (STEP 3):-add all images in webpage as sprite-combine js and cssfiles [COMBRES]-Turn on caching [web.config]
  • #14: SHOW YSLOW!SHOW SPEEDTRACERSHOW BLAZE.IO FINISHSHOW FIREBUGSHOW LOADS.IN
  • #17: -blitz.iobrowsermob-proxy (http://opensource.webmetrics.com/browsermob-proxy/)- benchmark - allows benchmarking on functions (http://benchmarkjs.com/)- cssstress - to test css profiling (https://github.com/andyedinborough/stress-css)
  • #18: src.sencha.io -> (http://www.sencha.com/learn/how-to-use-src-sencha-io/) resizes the image to fit the physical screen (MOBILE)- imagealpha -> (http://pngmini.com/) converts 24-bit PNG to paletted 8-bit PNG (MOBILE)8-bit is kinda like a gif (256 color palette)
  • #19: Rely on service oriented architectureSeparate your data Transactional vs. reportingSeparate I/O and CPU bound processes on different machinesRandom disk i/oUtilize event sourcing patternsqueuing/messaging- service bus- cqrs- eventual consistency- concurrent operations- async- be careful of tail latency (concurrent requests that the parent request depends on all completing)- duplicate work to rid of latency (multiple requests for same data to different servers.  Only take the first responding and disregard the rest) (http://highscalability.com/blog/2012/3/12/google-taming-the-long-latency-tail-when-more-machines-equal.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+HighScalability+%28High+Scalability%29&utm_content=Google+Feedfetcher- EVENTUAL CONSISTENCY- use a write DB and a read DB and sync between the two.- no locks, etc.- (http://pbs.cs.berkeley.edu/#demo)- understand the tradeoffs
  • #20: CACHE- Use memcached or Redis- A significant portion of an application’s  resources is consumed by I/O operations, which usually are data accesses.- Increases memory usage- too much memory utilized will start using swap (& move pages to virtual mem - hard disk) - increased I/O - no caching benefits- If data req can be predicted, then prefetch into cache; else, lazy load- Primed cache - set of required resources can be predicted (PREFETCH)- Demand cache - set of required resources cannot be predicted- Cache Accessor- Cache Search Sequence- Cache Collector- Cache Replicator- Cache Statistics- ASP.NET Caching (http://msdn.microsoft.com/en-us/library/cc668225)- Application Cache - not stored in memory for life of the application- Page output cache - store rendered HTML- cache whole page or part of it- for those pages that are always the same (profile page)- Caching data for ASP.NETSHOW DEMO (STEP 4):-update to use memory cache
  • #21: Long & short running queries- Write/write conflicts- Large joins
  • #22: Be careful of Object Relational MappingsDon’t rely on Exceptions for logicPoolingThreadsDBbatch requests- batch responses (stored procedures returning multiple results)- Ahead of-time compilation (NGen in CLR) may improve over JIT- Large object fragmentation- Split arrays into smaller units so that they remain below 85kB (and so are never allocated on the large object heap).- You can allocate the largest and longest-living objects first (if your objects are files which are queued for processing, for example).- In some cases, it may be that periodically stopping and restarting the program is the only option.understand operation impact in .NET on performance- Integer arithmetic is 1 instruction count while object allocation can be more than 1,000 (http://msdn.microsoft.com/en-us/magazine/cc507639.aspx)Again memory is good. The right memory is best:Memory consumption- CPU-intensive application manipulating large amount of data- L1 Cache ⇒ L2 Cache ⇒ RAM ⇒ DISK (speed decreases 10 fold in memory and 10,000 fold in disk- Cold startupWORKER THREADS- The request architecture of ASP.NET balances between request threads and available resources. - Thread gating - number of concurrently executing requests for which CPU power available. - Monitor thread gating in the Windows Performance monitor using the Pipeline Instance Count performance counter.- Page request generally stops until external resource (db/service requests) responds- The result can be many concurrently executing requests and many waiting threads in the ASP.NET worker process or application pool. - To reduce this effect on performance, you can manually set the limit on the number of threads in the process. - To do so, change the MaxWorkerThreads and MaxIOThreads attributes in the processModel section of the Machine.config file.- You can determine what the appropriate number of threads is by performance-testing your application.thread deadlocks- single thread can be blocked waiting on disk (fetching data), network (cross-machine resources), event/locks (waiting on other threads)
  • #23: SHOW DEMO FOR GLIMPSESHOW DEMO FOR PROFILER
  • #24: Show example forperfmon and measureit
  • #25: 5 minutes (59 minutes)SDLCRequirementsperformance goals- Architecture - performance metrics/SLAs- Development - profiling/prototyping- Testing - load testing- Continuous Integration testing- blitz.io- http://code.google.com/p/harstorage/ with Selenium testing- profiling on Unit Tests - (VS 2010 profiler - http://blogs.msdn.com/b/profiler/archive/2010/01/08/how-to-profilenunit-tests-using-the-visual-studio-2010-profiler.aspx)
  • #26: - Identify critical business transactions- frequently used transactions- performance-intensive transactions
  • #27: - do not prematurely optimize- CQRS- split up write services and read services- Start with 3rd party tools but if necessary, roll out your own- Sometimes standard solutions don’t fit - don’t be afraid to write custom (http://drjosiah.blogspot.com/2011/09/improving-performance-by-1000x.html)- When diagnosing, go for bottleneck and retest. That will lead you to your next bottleneck- Identify critical business transactions- frequently used transactions- performance-intensive transactionsSPDY (http://dev.chromium.org/spdy/spdy-whitepaper)BEFOREsingle request per connectionexclusively client-initiated requestsuncompressed request/response headers (gzip doesn’t help)redundant headers (User-Agent, Host, Accept* are usually static)AFTER:- multiple requests per connection (TCP conn doesn’t close)- compresses/eliminates headers- SSL first class- request prioritization- server push (X-Associated-Content)- suggest to the client to ask for specific resources (X-Subresources)- HTTP 2.0 - MS - just a proposal unlike SPDY (http://tools.ietf.org/html/draft-montenegro-httpbisspeed-mobility-01)- ResourceTiming (http://w3c-test.org/webperf/specs/ResourceTiming/)- ZeroMQSHOW DEMO:Show difference between the first response in waterfall to the last response in waterfall and the difference (RUN YSLOW AGAIN AND SHOW DIFFERENCE)