SlideShare uma empresa Scribd logo
1 de 53
Fail Whale
Scaling & Rails



You scale a website,
   not a framework
Scaling SOP's



General Things Standard Operating
         Procedures for
         website scaling
OODA Loop
OODA Loop
Observe



        New Relic
Client (customers) needs
       User needs
Rumsfeld
Rumsfeld



  Known knowns
 Known unknowns
Unknown unknowns
Observe:



          Known knowns:
What do we know that we know about
              clients?
Observe: Known unknowns



Do we know that we know at least a
few pages users are likely to hit
              often?
Observe: Known unknowns


We know users will use some features
          more than others.

We don't know which ones they will
                be.
Observe: Known unknowns


We know which devices they will be
    consuming the site with.

We don't know the percentages for
              sure.
Observe: Unknown unknowns



What assumptions do we bring, and
   which of them may be wrong?
Orient




Focus on the known knowns
Orient



We know the strategies:
Orient


  Page Caching
Fragment Caching
 Action Caching
Database Caching
Decide


         Por ejemplo:
To cache the landing page, or
    articles, or products
              Or
       All of the above
Act

class ProductsController < ApplicationController
  caches_page :index, :show
  def index
    @products = Product.page(params[:page]).per_page(10)
  end

  def show
    @product = Product.find(params[:id])
  end

  # Other actions omitted.
end
Act


class ProductSweeper < ActionController::Caching::Sweeper
  observe Product

  def after_update(product)
    expire_page products_path
    expire_page product_path(product)
    expire_page "/"
    FileUtils.rm_fr "#{page_cache_directory}/products/page"
  end
end
Iterate
Observe


What do we learn from Httperf
         + Browsermob
        + Apache Bench
       + user feedback?
Observe



What have we learned about our
            SOP's?
Observe



Which known unknowns have become
          Known knowns?
Observe



Which Unknown unknowns have become
          Known unknowns?
Orient



Which techniques can be used to
    solve the known knowns?
Iterate
Mise en place
[Miz on plas]

     Mise en place (pronounced [miz on plas],
literally "putting in place") is a French phrase
 defined by the Culinary Institute of America as
 "everything in place", as in set up. It is used
 in professional kitchens to refer to organizing
  and arranging the ingredients (e.g., cuts of
    meat, relishes, sauces, par-cooked items,
  spices, freshly chopped vegetables, and other
  components) that a cook will require for the
  menu items that he or she expects to prepare
             during his/her shift.[1]
GT mise en place


What might our developer kitchen look like?


           Our staging kitchen?


         Our production kitchen?
Development kitchen


         Livereload
            Rspec
          Cucumber

    Caching is turned off
Development kitchen




    Should we turn it on?
Development kitchen




    Should we turn it on?
Development kitchen



     HTTPerf & friends:
Allow us to do load testing
Development kitchen


                 Apache bench

$ ab -n 5 -c 5 http://127.0.0.1:3000/articles

-n requests is the number of requests
-c concurrency is the number of multiple requests
Development kitchen


                     HTTPerf

$ brew install httperf
$ httperf --num-conns=20 --rate=10 --timeout=5
--server=localhost --port=3000 --uri=/articles
Development kitchen



            Autobench:
Allows us to measure load testing
        On local machines
Development kitchen



 Should each developer explicitly
test with caching turned on before
        pushing to master?
Development kitchen



Or is this inefficient and
        confusing?
Development kitchen



(Discuss, decide, act, observe,
        orient, iterate)
Staging Kitchen



CI server runs test suite twice:
Staging kitchen



First Jenkins runs with caching off
Staging kitchen



Then Jenkins runs with
   caching turned on
Staging kitchen




Then code gets pushed to staging
Staging kitchen



Should features be accepted if they
    only pass with caching off?
Staging kitchen



If so, we need a second environment,
similar to staging, where caching is
             turned on.
Staging kitchen



(Discuss, decide, act, observe,
        orient, iterate)
Production kitchen



What process do we have in place to
        get user feedback?
Production kitchen



Do we rely on our tools?
Production kitchen



How do we get user feedback?
Production kitchen



Do we get it from our clients, who
        are not our users?
Production kitchen



Or do we get it directly (somehow?)
To be answered:
1) Do we turn caching on in
development?

2) Do we run tests against caching
before pushing?

3) Do we accept features that
haven't passed caching?
Discuss

Mais conteúdo relacionado

Semelhante a Scalingprezo

Continues Deployment - Tech Talk week
Continues Deployment - Tech Talk weekContinues Deployment - Tech Talk week
Continues Deployment - Tech Talk week
rantav
 
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil DibowitzAtmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
PROIDEA
 
appserver.io tutorial
appserver.io tutorialappserver.io tutorial
appserver.io tutorial
appserver.io
 

Semelhante a Scalingprezo (20)

The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
loadrunner
loadrunnerloadrunner
loadrunner
 
Continues Deployment - Tech Talk week
Continues Deployment - Tech Talk weekContinues Deployment - Tech Talk week
Continues Deployment - Tech Talk week
 
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil DibowitzAtmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
 
What is Chef and how we use it at tripsta
What is Chef and how we use it at tripstaWhat is Chef and how we use it at tripsta
What is Chef and how we use it at tripsta
 
High availability in IT: AAAARGH
High availability in IT: AAAARGHHigh availability in IT: AAAARGH
High availability in IT: AAAARGH
 
Test Driven Infrastructure
Test Driven InfrastructureTest Driven Infrastructure
Test Driven Infrastructure
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as Code
 
Production Readiness Strategies in an Automated World
Production Readiness Strategies in an Automated WorldProduction Readiness Strategies in an Automated World
Production Readiness Strategies in an Automated World
 
JustEnoughDevOpsForDataScientists
JustEnoughDevOpsForDataScientistsJustEnoughDevOpsForDataScientists
JustEnoughDevOpsForDataScientists
 
Don't hate, automate. lessons learned from implementing continuous delivery
Don't hate, automate. lessons learned from implementing continuous deliveryDon't hate, automate. lessons learned from implementing continuous delivery
Don't hate, automate. lessons learned from implementing continuous delivery
 
High Stakes Continuous Delivery in the Real World #OpenWest
High Stakes Continuous Delivery in the Real World #OpenWestHigh Stakes Continuous Delivery in the Real World #OpenWest
High Stakes Continuous Delivery in the Real World #OpenWest
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Continuous delivery is more than dev ops
Continuous delivery is more than dev opsContinuous delivery is more than dev ops
Continuous delivery is more than dev ops
 
Picnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable applicationPicnic Software - Developing a flexible and scalable application
Picnic Software - Developing a flexible and scalable application
 
appserver.io tutorial
appserver.io tutorialappserver.io tutorial
appserver.io tutorial
 
Keeping Your DevOps Transformation From Crushing Your Ops Capacity
Keeping Your DevOps Transformation From Crushing Your Ops Capacity Keeping Your DevOps Transformation From Crushing Your Ops Capacity
Keeping Your DevOps Transformation From Crushing Your Ops Capacity
 
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
Pitchero - Increasing agility through DevOps - Leeds DevOps November 2016
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 

Último

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Último (20)

AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 

Scalingprezo