SlideShare une entreprise Scribd logo
1  sur  47
Rails Performance
   In the Cloud




                     1
About Me

            Tom Mornini

            •  Co-founder and CTO of
               Engine Yard

            •  Ruby on Rails advocate




                                        2
Agenda
Time                  Topic
8:45 am – 9:10 am     Introductions
9:10 am – 9:40 am     Amazon Web Services
9:40 am – 10:10 am    New Relic
10:10 am – 10:15 am   Break
10:15 am – 10:55 am   Engine Yard Cloud
10:55 am – 11:25 am   CVSDude
11:25 am – 11:55 am   CloudTest by Soasta
11:55 am – 12:00 pm   Wrap Up




                                            3
4
Why Ruby on Rails?



                      5
Rails Development Is 2x - 5x Faster




Source: Engine Yard Developer Survey 


                                               6
Rails Conventions




                     7
So Developers Can Focus on The Application




                                              8
Why Cloud Infrastructure?




                             9
Instant Programmable Infrastructure


                            # get a list of buckets
                            s3.get_service

                            # create a bucket
                            s3.put_bucket('bucketname')

                            # get the contents of that
                             bucket
                            s3.get_bucket('bucketname')

                            # delete that bucket
                            s3.delete_bucket('bucketname')




                                                      10
Disposable Resources Mean…




                              11
Only Pay For What You Use




                             12
Slow Pages Waste 4,908 Lifetimes Every Year! :)




                                                   13
High Performance = Customer Satisfaction




                                            14
High Performance = User Engagement




                                      15
Satisfied Customers Tell Other People




                                        16
Wikia: Exit Rate vs. Page Load Time
          30%



         23%
        • Wikia Source Data

          15%



            8%



            0%
                  0.0    1.0   2.0              3.0   4.0   5.0
                                     Seconds
Source: Velocity 2009


                                                              17
Google Search Latency Experiment


                                                          •  Measure result of artificially
                                                             induced latency

                                                          •  Search volume per user
                                                             decreased by 0.8% with an
                                                             artificial 400ms delay

                                                          •  Effect cumulative over time
                                                             and persisted after
                                                             experiment’s timeframe



Source: http://code.google.com/speed/files/delayexp.pdf


                                                                                          18
High Performance = AdWord Ranking




http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=93112


                                                                         19
High Performance = Organic Search Benefit?


• Certainty: very slow pages are skipped by indexer

• Possibility: slower pages = higher bounce rate = lower
  organic search score




                                                       20
Performance = Competitive Advantage




                                       21
Everyone Hates Waiting




                          22
Let’s Get More Concrete
                      23
HOME PAGE


             SEARCH




                       24
The Four Stages of Performance
Delight
      



          Satisfaction


(<1s)
    
                          Frustration


           (1-4s)
                
                        Abandonment
                                                   


                          (4-8s)
                               


                                         (8s+)
                                             
                                                       25
Conventional Wisdom: Performance Thresholds


                  Delight (<1s)


                                  Satisfaction (1-4s)

                                                     Frustration (4-8s)
                    3.4s
                       
                Average Web
                 Load Time
                         
                                                                Abandonment (8-20s)



Source: Apdex, http://blog.gomez.com/2009/08/a-look-at-the-browser-wars/


                                                                                       26
Page Load Performance: 100 Rails Sites

          25


          20                                                  Google Analytics, Ads
                                                          DoubleClick FBConnect, CDNs…


          15


          10                                  3.1s Median Load Time

            5


            0
                                                                              US average web-site load time 3.4s
Sources: Engine Yard Rails Site Survey, using Yahoo! YSlow


                                                                                                               27
So How Do I…?




                 28
Just Follow These Few Simple Strategies…

                                    No XMLhttprequest
                                                    
                             DatamapperTuned
                                      
SQL
                         Asynchronous Processing
                    Avoid eval
                             
                     
Multiple Asset   Hosts
SMP Hardware
JRuby
No CSS Expressions
 Close your HTML tags
     Tokyo          Cabinet
InterNAP
 Work Brokers
Preloading
   Linux Tuning Fragment Caching
 Nehalem
                                           Less Gzip
 No Redirects
               
         Lockrun
   NoSQL
10 GiGE
 Redis
SSD’s
 More Gzip
                                            CDN
      eTag Caching In
                  
       memory caching
 Cassandra
                            Script Decoalescing
            http caching Native Hardware
                        
               Virtualized Hardware
Page Caching
                                           iFrames
 Multi-cast
       DB Sharding   
                       memcached
 Action Caching
              Xen Tuning

            Ruby 1.9
 AMQP
                            Cookie Free Domains
Minimize DOM 
                CSS Sprites
MongoDB
 Script coalescing
                      Message Buses Lazy Loading
                                  
                        No Image Resizing
Minify Text
 JVM Flags
                              Unicorn
 Image     Pre-Compression
                                    Efficient Javascript Object Instantiation




                                                                                                       29
There are Many Levers In"
Performance Optimization

                            30
But Only A Few Matter


                         31
Five Sources of High Performance


1.  Page Construction

2.  Application Code

3.  Software Architecture

4.  Component Selection

5.  Infrastructure Capacity



                                    32
1. Page Construction



                        • Page size
                        • Javascript size
                        • Load order
                        • Image configuration
                        • http requests
                        • Domain configuration
                        • CSS layout
                        • …

                                             33
The Rules for Optimized Page Construction


 1. Minimize HTTP Requests
             12. Remove Duplicate Scripts
 2. Use a Content Delivery Network
     13. Configure ETags
 3. Expires or Cache-Control Headers
   14. Make AJAX Cacheable
 4. Gzip Components
                    15. Use GET for AJAX Requests
 5. Put StyleSheets at the Top
         16. Reduce the Number of DOM Elements
 6. Put Scripts at the Bottom
          17. No 404s
 7. Avoid CSS Expressions
              18. Reduce Cookie Size
 8. Make JavaScript and CSS External
   19. Use Cookie-Free Domains 
 9. Reduce DNS Lookups
                 20. Avoid Filters
10. Minify JavaScript and CSS
          21. Do Not Scale Images in HTML
11. Avoid Redirects
                    22. Make favicon.ico Small and Cacheable



Source: ySlow Performance Checks

                                                                          34
Engine Yard and Rails to the Rescue
                                                 


 1. Minimize HTTP Requests
             12. Remove Duplicate Scripts
 2. Use a Content Delivery Network
     13. Configure ETags
 3. Expires or Cache-Control Headers
   14. Make AJAX Cacheable
 4. Gzip Components
                    15. Use GET for AJAX Requests
 5. Put StyleSheets at the Top
         16. Reduce the Number of DOM Elements
 6. Put Scripts at the Bottom
          17. No 404s
 7. Avoid CSS Expressions
              18. Reduce Cookie Size
 8. Make JavaScript and CSS External
   19. Use Cookie-Free Domains 
 9. Reduce DNS Lookups
                 20. Avoid Filters
10. Minify JavaScript and CSS
          21. Do Not Scale Images in HTML
11. Avoid Redirects
                    22. Make favicon.ico Small and Cacheable


Rails 3 Bringing Even More: CSS Sprite Support and Lazy JavaScript

                                                                          35
Engine Yard Rails Site Survey Findings


• # of HTTP requests and JavaScript payload size were
   the statistically significant contributors to load time

• Each http request adds 0.04s to page download time

• Each 100Kb of JavaScript = 0.74s added to load time
  •  Many pages constructed with blocking JavaScript loads
  •  25% of payload is now JavaScript




                                                             36
2. Patterns of Fast Rails Application Code


• Eager loading of associations

• Do as little as possible during the http request cycle

• Gem due diligence




                                                           37
3. Suitable Architecture (For Your Scale)




                                             38
Foundation: Patterns of Performance At Scale


                                                                               Non
Difficulty of Implementation



                                                                              ACID
                                                                            Datastores

                                                                       Sharded
                                                                        Data
                                                           Task
                                                        Partitioned
                                            Asynch 
       Data
                                          Processing
                                Caches



                                                          Scale
                                                                                          39
Foundation: High Performance Components




                                           40
Engine Yard Stack




                     41
Rails 3 + Ruby 1.9 Benchmarks


• Substantial effort to refactor out slowness in common
  operations
• Micro-benchmarks seeing 2-8x + improvements
  •  Hello World
  •  Render
  •  Partials
  •  10 Partials
  •  Collections




                                                          42
Foundation: Sufficient Infrastructure Resources




                           • Resource monitoring
                           • Process monitoring
                           • Uptime monitoring
                           • React on-demand




                                                   43
Don’t make people wait
                     
                         44
Focus on end user performance
                             45
Pull the right levers


                         46
Choose the right partners
                        
                            47

Contenu connexe

Tendances

Netflix Global Cloud Architecture
Netflix Global Cloud ArchitectureNetflix Global Cloud Architecture
Netflix Global Cloud ArchitectureAdrian Cockcroft
 
WSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of view
WSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of viewWSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of view
WSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of viewWSO2
 
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptxGab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptxVincent Thavonekham-Pro
 
(SPOT302) Availability: The New Kind of Innovator’s Dilemma
(SPOT302) Availability: The New Kind of Innovator’s Dilemma(SPOT302) Availability: The New Kind of Innovator’s Dilemma
(SPOT302) Availability: The New Kind of Innovator’s DilemmaAmazon Web Services
 
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Mariano Gonzalez
 
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...Acquia
 
Site reliability in the Serverless age - Serverless Boston 2019
Site reliability in the Serverless age  - Serverless Boston 2019Site reliability in the Serverless age  - Serverless Boston 2019
Site reliability in the Serverless age - Serverless Boston 2019Erik Peterson
 
The Lean Cloud for Startups with AWS - Cost Optimisation
The Lean Cloud for Startups with AWS - Cost OptimisationThe Lean Cloud for Startups with AWS - Cost Optimisation
The Lean Cloud for Startups with AWS - Cost OptimisationAmazon Web Services
 
One Does Not Simply Walk Into Devops
One Does Not Simply Walk Into Devops One Does Not Simply Walk Into Devops
One Does Not Simply Walk Into Devops Uri Cohen
 
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)Adrian Cockcroft
 
Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...
Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...
Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...Continuent
 
Virtualize with bare metal performance
Virtualize with bare metal performanceVirtualize with bare metal performance
Virtualize with bare metal performanceDeba Chatterjee
 
Simplify IT Event: Demistifying the Cloud
Simplify IT Event: Demistifying the CloudSimplify IT Event: Demistifying the Cloud
Simplify IT Event: Demistifying the CloudMichael Brooker
 
Performance Testing : Cloud Deployments
Performance Testing : Cloud DeploymentsPerformance Testing : Cloud Deployments
Performance Testing : Cloud DeploymentsShreyas Chaudhari
 
Cloud Economics: Optimising for Cost
Cloud Economics: Optimising for CostCloud Economics: Optimising for Cost
Cloud Economics: Optimising for CostAmazon Web Services
 
The Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud SummitThe Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud SummitRandy Bias
 
Top 10 Application Problems
Top 10 Application ProblemsTop 10 Application Problems
Top 10 Application ProblemsAppDynamics
 
SV Forum Platform Architecture SIG - Netflix Open Source Platform
SV Forum Platform Architecture SIG - Netflix Open Source PlatformSV Forum Platform Architecture SIG - Netflix Open Source Platform
SV Forum Platform Architecture SIG - Netflix Open Source PlatformAdrian Cockcroft
 

Tendances (20)

Netflix Global Cloud Architecture
Netflix Global Cloud ArchitectureNetflix Global Cloud Architecture
Netflix Global Cloud Architecture
 
Gluecon keynote
Gluecon keynoteGluecon keynote
Gluecon keynote
 
WSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of view
WSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of viewWSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of view
WSO2Con EU 2015: Keynote - Cloud Native Apps… from a user point of view
 
Netflix in the Cloud
Netflix in the CloudNetflix in the Cloud
Netflix in the Cloud
 
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptxGab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
Gab2015 nicolas fonrose_costefficiencywithmicrosoftazure.pptx
 
(SPOT302) Availability: The New Kind of Innovator’s Dilemma
(SPOT302) Availability: The New Kind of Innovator’s Dilemma(SPOT302) Availability: The New Kind of Innovator’s Dilemma
(SPOT302) Availability: The New Kind of Innovator’s Dilemma
 
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015 Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
Zero Downtime with OSGi - Chicago Coder Conference 05-15-2015
 
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
Acquia Managed Cloud: Highly Available Architecture for Highly Unpredictable ...
 
Site reliability in the Serverless age - Serverless Boston 2019
Site reliability in the Serverless age  - Serverless Boston 2019Site reliability in the Serverless age  - Serverless Boston 2019
Site reliability in the Serverless age - Serverless Boston 2019
 
The Lean Cloud for Startups with AWS - Cost Optimisation
The Lean Cloud for Startups with AWS - Cost OptimisationThe Lean Cloud for Startups with AWS - Cost Optimisation
The Lean Cloud for Startups with AWS - Cost Optimisation
 
One Does Not Simply Walk Into Devops
One Does Not Simply Walk Into Devops One Does Not Simply Walk Into Devops
One Does Not Simply Walk Into Devops
 
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
Gluecon 2013 - Netflix Cloud Native Tutorial Details (part 2)
 
Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...
Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...
Webinar Slides: Global MySQL Availability: SaaS Cloud Contact Center Secures ...
 
Virtualize with bare metal performance
Virtualize with bare metal performanceVirtualize with bare metal performance
Virtualize with bare metal performance
 
Simplify IT Event: Demistifying the Cloud
Simplify IT Event: Demistifying the CloudSimplify IT Event: Demistifying the Cloud
Simplify IT Event: Demistifying the Cloud
 
Performance Testing : Cloud Deployments
Performance Testing : Cloud DeploymentsPerformance Testing : Cloud Deployments
Performance Testing : Cloud Deployments
 
Cloud Economics: Optimising for Cost
Cloud Economics: Optimising for CostCloud Economics: Optimising for Cost
Cloud Economics: Optimising for Cost
 
The Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud SummitThe Cloud Revolution - Philippines Cloud Summit
The Cloud Revolution - Philippines Cloud Summit
 
Top 10 Application Problems
Top 10 Application ProblemsTop 10 Application Problems
Top 10 Application Problems
 
SV Forum Platform Architecture SIG - Netflix Open Source Platform
SV Forum Platform Architecture SIG - Netflix Open Source PlatformSV Forum Platform Architecture SIG - Netflix Open Source Platform
SV Forum Platform Architecture SIG - Netflix Open Source Platform
 

Similaire à Rails Performance in the Cloud Optimization

Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引冰 郭
 
Performance Oriented Design
Performance Oriented DesignPerformance Oriented Design
Performance Oriented DesignRodrigo Campos
 
Java overview the piramide of success
Java overview the piramide of successJava overview the piramide of success
Java overview the piramide of successArtem Bilan
 
Expecto Performa! The Magic and Reality of Performance Tuning
Expecto Performa! The Magic and Reality of Performance TuningExpecto Performa! The Magic and Reality of Performance Tuning
Expecto Performa! The Magic and Reality of Performance TuningAtlassian
 
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Andreas Grabner
 
10 things ever architect should know about the Windows Azure Platform - ericnel
10 things ever architect should know about the Windows Azure Platform -  ericnel10 things ever architect should know about the Windows Azure Platform -  ericnel
10 things ever architect should know about the Windows Azure Platform - ericnelEric Nelson
 
Web Performance 101 - Gil Givati
Web Performance 101 - Gil GivatiWeb Performance 101 - Gil Givati
Web Performance 101 - Gil GivatiMika Josting
 
Restful web services with nodejs
Restful web services with nodejsRestful web services with nodejs
Restful web services with nodejsAspenware
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in ReactTalentica Software
 
Getting started with Office 365 SharePoint 2010 online development
Getting started with Office 365 SharePoint 2010 online developmentGetting started with Office 365 SharePoint 2010 online development
Getting started with Office 365 SharePoint 2010 online developmentJeremy Thake
 
Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)SOASTA
 
Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)SOASTA
 
Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)Tammy Everts
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedPromet Source
 
MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...MeasureWorks
 
Starfish: A Self-tuning System for Big Data Analytics
Starfish: A Self-tuning System for Big Data AnalyticsStarfish: A Self-tuning System for Big Data Analytics
Starfish: A Self-tuning System for Big Data AnalyticsGrant Ingersoll
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterJohn Adams
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 

Similaire à Rails Performance in the Cloud Optimization (20)

Making the web faster
Making the web fasterMaking the web faster
Making the web faster
 
Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引
 
Performance Oriented Design
Performance Oriented DesignPerformance Oriented Design
Performance Oriented Design
 
Java overview the piramide of success
Java overview the piramide of successJava overview the piramide of success
Java overview the piramide of success
 
Expecto Performa! The Magic and Reality of Performance Tuning
Expecto Performa! The Magic and Reality of Performance TuningExpecto Performa! The Magic and Reality of Performance Tuning
Expecto Performa! The Magic and Reality of Performance Tuning
 
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
Deploy Faster Without Failing Faster - Metrics-Driven - Dynatrace User Groups...
 
10 things ever architect should know about the Windows Azure Platform - ericnel
10 things ever architect should know about the Windows Azure Platform -  ericnel10 things ever architect should know about the Windows Azure Platform -  ericnel
10 things ever architect should know about the Windows Azure Platform - ericnel
 
Web Performance 101 - Gil Givati
Web Performance 101 - Gil GivatiWeb Performance 101 - Gil Givati
Web Performance 101 - Gil Givati
 
Restful web services with nodejs
Restful web services with nodejsRestful web services with nodejs
Restful web services with nodejs
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in React
 
Getting started with Office 365 SharePoint 2010 online development
Getting started with Office 365 SharePoint 2010 online developmentGetting started with Office 365 SharePoint 2010 online development
Getting started with Office 365 SharePoint 2010 online development
 
Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)
 
Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)
 
Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...
 
Starfish: A Self-tuning System for Big Data Analytics
Starfish: A Self-tuning System for Big Data AnalyticsStarfish: A Self-tuning System for Big Data Analytics
Starfish: A Self-tuning System for Big Data Analytics
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
Lattice yapc-slideshare
Lattice yapc-slideshareLattice yapc-slideshare
Lattice yapc-slideshare
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 

Dernier

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 

Dernier (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 

Rails Performance in the Cloud Optimization

  • 1. Rails Performance In the Cloud 1
  • 2. About Me Tom Mornini •  Co-founder and CTO of Engine Yard •  Ruby on Rails advocate 2
  • 3. Agenda Time Topic 8:45 am – 9:10 am Introductions 9:10 am – 9:40 am Amazon Web Services 9:40 am – 10:10 am New Relic 10:10 am – 10:15 am Break 10:15 am – 10:55 am Engine Yard Cloud 10:55 am – 11:25 am CVSDude 11:25 am – 11:55 am CloudTest by Soasta 11:55 am – 12:00 pm Wrap Up 3
  • 4. 4
  • 5. Why Ruby on Rails? 5
  • 6. Rails Development Is 2x - 5x Faster Source: Engine Yard Developer Survey 6
  • 8. So Developers Can Focus on The Application 8
  • 10. Instant Programmable Infrastructure # get a list of buckets s3.get_service # create a bucket s3.put_bucket('bucketname') # get the contents of that bucket s3.get_bucket('bucketname') # delete that bucket s3.delete_bucket('bucketname') 10
  • 12. Only Pay For What You Use 12
  • 13. Slow Pages Waste 4,908 Lifetimes Every Year! :) 13
  • 14. High Performance = Customer Satisfaction 14
  • 15. High Performance = User Engagement 15
  • 16. Satisfied Customers Tell Other People 16
  • 17. Wikia: Exit Rate vs. Page Load Time 30% 23% • Wikia Source Data 15% 8% 0% 0.0 1.0 2.0 3.0 4.0 5.0 Seconds Source: Velocity 2009 17
  • 18. Google Search Latency Experiment •  Measure result of artificially induced latency •  Search volume per user decreased by 0.8% with an artificial 400ms delay •  Effect cumulative over time and persisted after experiment’s timeframe Source: http://code.google.com/speed/files/delayexp.pdf 18
  • 19. High Performance = AdWord Ranking http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=93112 19
  • 20. High Performance = Organic Search Benefit? • Certainty: very slow pages are skipped by indexer • Possibility: slower pages = higher bounce rate = lower organic search score 20
  • 23. Let’s Get More Concrete 23
  • 24. HOME PAGE SEARCH 24
  • 25. The Four Stages of Performance Delight Satisfaction (<1s) Frustration (1-4s) Abandonment (4-8s) (8s+) 25
  • 26. Conventional Wisdom: Performance Thresholds Delight (<1s) Satisfaction (1-4s) Frustration (4-8s) 3.4s Average Web Load Time Abandonment (8-20s) Source: Apdex, http://blog.gomez.com/2009/08/a-look-at-the-browser-wars/ 26
  • 27. Page Load Performance: 100 Rails Sites 25 20 Google Analytics, Ads DoubleClick FBConnect, CDNs… 15 10 3.1s Median Load Time 5 0 US average web-site load time 3.4s Sources: Engine Yard Rails Site Survey, using Yahoo! YSlow 27
  • 28. So How Do I…? 28
  • 29. Just Follow These Few Simple Strategies… No XMLhttprequest DatamapperTuned SQL Asynchronous Processing Avoid eval Multiple Asset Hosts SMP Hardware JRuby No CSS Expressions Close your HTML tags Tokyo Cabinet InterNAP Work Brokers Preloading Linux Tuning Fragment Caching Nehalem Less Gzip No Redirects Lockrun NoSQL 10 GiGE Redis SSD’s More Gzip CDN eTag Caching In memory caching Cassandra Script Decoalescing http caching Native Hardware Virtualized Hardware Page Caching iFrames Multi-cast DB Sharding memcached Action Caching Xen Tuning Ruby 1.9 AMQP Cookie Free Domains Minimize DOM CSS Sprites MongoDB Script coalescing Message Buses Lazy Loading No Image Resizing Minify Text JVM Flags Unicorn Image Pre-Compression Efficient Javascript Object Instantiation 29
  • 30. There are Many Levers In" Performance Optimization 30
  • 31. But Only A Few Matter 31
  • 32. Five Sources of High Performance 1.  Page Construction 2.  Application Code 3.  Software Architecture 4.  Component Selection 5.  Infrastructure Capacity 32
  • 33. 1. Page Construction • Page size • Javascript size • Load order • Image configuration • http requests • Domain configuration • CSS layout • … 33
  • 34. The Rules for Optimized Page Construction 1. Minimize HTTP Requests 12. Remove Duplicate Scripts 2. Use a Content Delivery Network 13. Configure ETags 3. Expires or Cache-Control Headers 14. Make AJAX Cacheable 4. Gzip Components 15. Use GET for AJAX Requests 5. Put StyleSheets at the Top 16. Reduce the Number of DOM Elements 6. Put Scripts at the Bottom 17. No 404s 7. Avoid CSS Expressions 18. Reduce Cookie Size 8. Make JavaScript and CSS External 19. Use Cookie-Free Domains 9. Reduce DNS Lookups 20. Avoid Filters 10. Minify JavaScript and CSS 21. Do Not Scale Images in HTML 11. Avoid Redirects 22. Make favicon.ico Small and Cacheable Source: ySlow Performance Checks 34
  • 35. Engine Yard and Rails to the Rescue 1. Minimize HTTP Requests 12. Remove Duplicate Scripts 2. Use a Content Delivery Network 13. Configure ETags 3. Expires or Cache-Control Headers 14. Make AJAX Cacheable 4. Gzip Components 15. Use GET for AJAX Requests 5. Put StyleSheets at the Top 16. Reduce the Number of DOM Elements 6. Put Scripts at the Bottom 17. No 404s 7. Avoid CSS Expressions 18. Reduce Cookie Size 8. Make JavaScript and CSS External 19. Use Cookie-Free Domains 9. Reduce DNS Lookups 20. Avoid Filters 10. Minify JavaScript and CSS 21. Do Not Scale Images in HTML 11. Avoid Redirects 22. Make favicon.ico Small and Cacheable Rails 3 Bringing Even More: CSS Sprite Support and Lazy JavaScript 35
  • 36. Engine Yard Rails Site Survey Findings • # of HTTP requests and JavaScript payload size were the statistically significant contributors to load time • Each http request adds 0.04s to page download time • Each 100Kb of JavaScript = 0.74s added to load time •  Many pages constructed with blocking JavaScript loads •  25% of payload is now JavaScript 36
  • 37. 2. Patterns of Fast Rails Application Code • Eager loading of associations • Do as little as possible during the http request cycle • Gem due diligence 37
  • 38. 3. Suitable Architecture (For Your Scale) 38
  • 39. Foundation: Patterns of Performance At Scale Non Difficulty of Implementation ACID Datastores Sharded Data Task Partitioned Asynch Data Processing Caches Scale 39
  • 42. Rails 3 + Ruby 1.9 Benchmarks • Substantial effort to refactor out slowness in common operations • Micro-benchmarks seeing 2-8x + improvements •  Hello World •  Render •  Partials •  10 Partials •  Collections 42
  • 43. Foundation: Sufficient Infrastructure Resources • Resource monitoring • Process monitoring • Uptime monitoring • React on-demand 43
  • 45. Focus on end user performance 45
  • 46. Pull the right levers 46
  • 47. Choose the right partners 47

Notes de l'éditeur

  1. Rails devs consistently report being 2-5 times faster at delivering feaueatures
  2. Convention over configuration
  3. Average page views over one second