SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
Capacity Planning
for fun & profit
         beyond cacti and top

    II São Paulo Perl Workshop
 Rodrigo Albani de Campos - @xinu
        camposr@gmail.com
Agenda

• Capacity planning primer: a tale of
  discovery
• Metrics
• Queues
• Models
Why Perl ?

• Main reason: I feel comfortable with it
• Ubiquitous and free
• Plenty of stable statistics modules available
  at CPAN
• Ultimately, it gets the job done
Capacity Planning
•   Is just like sex...
    •   Everyone wants to do it
    •   Many say they’re doing it
    •   You always exaggerate how much of it
        you’re doing
    •   Most people aren’t actually doing it (despite
        their best efforts)
    •   Everybody else seems to be doing more
        than you
A tale of discovery


There once was a system administrator...
A tale of discovery

       How many ?
       Actual capacity ?
   Servers do we need ?
    How much memory ?
 What’s the predicted growth ?
         IO Capacity ?
Typical Performance
        Metrics
• Load Average - uptime
 • The single most misunderstood metric
• CPU - mpstat
• IO - iostat
• Memory Usage - vmstat
Typical Performance
      Metrics
Time series charts
       I’m looking at you cacti huggers !

• Time series performance data is useful for:
 • Troubleshooting
 • Simplistic forecasting
 • Find trends
 • Identify seasonal behavior
• This left alone is NOT Capacity Planning
Frustration
• Computer systems can be harsh
• Most systems will not scale linearly
• Diminishing returns and lock contention
  will punch you in the face
• “Oh but I’ve checked cacti and the CPU
  was 25% idle”
Let’s put it in the Cloud

• We are moving back to an utility computing
  model
• You’re charged per usage
• Even more important to care about
  capacity planning !!!
Call the experts
                  • Cost per MIPS
                  • IBM System/370 model 158-3 - 1.0 MIPS @
                           1.0 MHz -1972
                         • Average purchase price: $ 771,000*
                          • No disks or peripherals included
                         • $ 4,082,039 by 2011
                  • Need to squeeze every drop of processing
                           power
* Source: http://www-03.ibm.com/ibm/history/exhibits/mainframe/mainframe_PP3135.html
Queues
The not so typical performance metrics
• 1961 - CTSS was first
  demonstrated at MIT
• 1965 - Allan Scherr used
  machine repairman
  problem to model a
  time-shared system as
  part of Project MAC
• Another offspring of
  Project MAC is Multics
Queues
The not so typical performance metrics

          Computer System
                            Disks



                  CPU
Queues
The not so typical performance metrics

          (A)    λ                          X   (C)
                                        S
Open/Closed               W
 Network                        R
    A                Arrival Count
    λ              Arrival Rate (A/T)
    W            Time spent in Queue
    R            Residence Time (W+S)
    S                Service Time
    X           System Throughput (C/T)
    C           Completed tasks count
Arrival Rate (λ)
• Pretty straightforward
• Requests per second/hour/day
• Not the same as throughput (X)
 • Although in a steady state:
   • A = C as T →∞
   • λ=X
Service Time (S)

• Time spent in processing
 • Web server response time
 • Total query time
 • IO operation time length
!"#$%&"'(%)"*+,'


                           Mythical Performance
                    !#)"




                    !#("




                    !#'"




                      • Not gonna happen...
!"#$%&"'(%)"'*+,'




                    !#&"
                                                                                                    *+,-./+"0.1+234"



                      • Don’t believe vendor’s sales pitch
                    !#%"




                      • “In God we trust, all others must bring
                                data” - William Edwards Deming
                    !#$"




                      !"
                           !"     ("   $!"   $("     %!"           %("      &!"   &("   '!"   '("
                                                   -##%$./'0.1"'*2%1+3+,'
Mythical Performance

• Not gonna happen...
• Don’t believe vendor’s sales pitch
• “In God we trust, all others must bring
  data” - William Edwards Deming
How to measure ?

• Apache: %D in mod_log_config
• nginx: $request_time in HttpLogModule
• use Benchmark;
• tcprstat - http://goo.gl/0cbYx
• collectd - http://goo.gl/OXKG7
• metrics - http://goo.gl/gQFVM
• sysstat - http://goo.gl/2aLul
How to measure ?
 my ($date,$svctime) = (m/[(S+).+?s(d+)$/);

 $arrivalRate{$date}++;

 $serviceTimeAcc{$date} += $svctime;



[02/Jul/2010:14:00:18... 1863

      Time to serve the
           request,
        in μseconds.
use Chart::Clicker;
use Chart::Clicker;
use Chart::Clicker;
use Chart::Clicker;



      Average Hits/s = 65.142
      Average Svc time = 0.0159
use Chart::Clicker;



      Average Hits/s = 65.142
      Average Svc time = 0.0159
What to look for ?

• Stretch factor
• Method/Operation
• Geolocation
• Cookies
 • Use mod_logio to measure inbound
    traffic as well
Modeling
Prediction is very difficult, especially if it’s about
the future.
                                           Niels Bohr
Capacity planning is about setting expectations.
Even wrong expectations are better than no
expectations!
          Neil J. Gunther - The Guerrilla Manifesto
                                http://goo.gl/lZKWH
Modeling

• A model is an abstraction of a complex
  system
• A model allows us to observe phenomena
  that cannot be easily replicated
Modeling Methods
• Statistics / Trending / Forecasting
 • Pros:
   • Easy to understand
   • Tools readily available
 • Cons:
   • Hard to create “What-if” scenarios
   • Hard to predict contention and
      bottlenecks
Modeling Methods
•   Queuing Analisys

    •   Pros:

        •   Allows you to make predictions when no
            production data is available

        •   Allows you to create “What-if” scenarios

    •   Cons:

        •   Sometimes it can be unintuitive

        •   The math behind it can be difficult
Queues as models
            Typical LAMP Stack

                 Clients



Requests                            Replies




   Apache      Application   Database
Queues as models
                            What if ?

                            Clients



        Requests                               Replies




Cache              Apache        Application   Database
Queues as models
What happens if we use a 15k RPM disk ?




         CPU           Disk 10k
                        RPM
Queues as models
  m1.small ? m1.large ? m1.xlarge ?




            Virtual Cores X
                EC2 CU




           Memory Bus
use pdq;

• Available at http://goo.gl/s98wQ (not on
  CPAN)
• PDQ is a queuing circuit solver by Neil J.
  Gunther
• There’s a whole book about it
  http://goo.gl/9MA2c
use pdq;
CreateNode()        Define a queuing center

                  Define a traffic stream of an
CreateOpen()
                         open circuit
                  Define a traffic stream of a
CreateClosed()
                       closed circuit
                 Define the service demand for
 SetDemand()
                  each of the queuing centers
use pdq;
      Node Types

CEN        Queuing Center

DLY         Delay Center
use pdq;
       Service Disciplines

FCFS           First-come first-served

LCFS           Last-come first-served

ISRV               Infinite Server

PSHR             Processor Sharing
use pdq;
• Apache Web Server
• Average Network RTD: 0.00921 seconds
 • Added as a delay center in the circuit
• Average Arrival Rate: 65.142 hits/s
• Average Service time: 0.0159 seconds
• 128 worker threads
use pdq;
$workload = "httpd";

$httpMaxClient = 128;

pdq::Init("web server");

$arrivalRate = 65.142;

$serviceTime = 0.1159;

$pdq::streams = 

   pdq::CreateOpen($workload,
   $arrivalRate);
pdq::Report();
Metric                Value   Unit

------                -----   ----

Workload: "httpd"

Number in system     8.0279   Trans

Mean throughput     65.1420   Trans/Sec

Response time        0.1232   Sec

Stretch factor       1.0626
pdq::Report();

Bounds Analysis:

Max throughput     1104.4003   Trans/Sec

Min response          0.1160   Sec
pdq::Report();

• Average request size: 145 KBytes
  • ~ 1160 Kbits
• @1104 transactions / second:
  • 1,280,640 Kbits /s ~ 1.28 Gbps
Resources and
       References
• CMG Public Proceedings:
  http://www.cmg.org/proceedings/
• Measure IT:
  http://www.cmg.org/measureit/
• Guerrilla Capacity Planning
  http://www.perfdynamics.com/Classes/
  Outlines/guerilla.html
Resources and
       References
• Performance by Design - Menasce, Dowdy,
  Almeida - http://amzn.to/mpqfVO
• Capacity Planning for Web Performance:
  Metrics, Models, and Methods - Daniel
  Menasce,Virgilio Almeida - http://amzn.to/
  lOATba
• Capacity Planning for Web Services: Metrics,
  Models, and Methods - Daniel Menasce,
  Virgilio Almeida - http://amzn.to/iClpsB
Resources and
       References
• Guerrilla Capacity Planning: A Tactical
  Approach to Planning for Highly Scalable
  Applications and Services - Neil Gunther -
  http://amzn.to/kfrfLK
• The Art of Computer Systems Performance
  Analysis: Techniques for Experimental Design,
  Measurement, Simulation, and Modeling - R.
  K. Jain - http://amzn.to/jqud1I
Any questions ?

Mais conteúdo relacionado

Mais procurados

Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesStéphane Maldini
 
Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015Joel Koshy
 
KubeCon 2019 Recap (Parts 1-3)
KubeCon 2019 Recap (Parts 1-3)KubeCon 2019 Recap (Parts 1-3)
KubeCon 2019 Recap (Parts 1-3)Ford Prior
 
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Marcus Barczak
 
(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPC
(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPC(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPC
(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPCAmazon Web Services
 
How Yelp does Service Discovery
How Yelp does Service DiscoveryHow Yelp does Service Discovery
How Yelp does Service DiscoveryJohn Billings
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsKonrad Malawski
 
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
Go Reactive: Event-Driven, Scalable, Resilient & Responsive SystemsGo Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
Go Reactive: Event-Driven, Scalable, Resilient & Responsive SystemsJonas Bonér
 
Breaking Spark: Top 5 mistakes to avoid when using Apache Spark in production
Breaking Spark: Top 5 mistakes to avoid when using Apache Spark in productionBreaking Spark: Top 5 mistakes to avoid when using Apache Spark in production
Breaking Spark: Top 5 mistakes to avoid when using Apache Spark in productionNeelesh Srinivas Salian
 
Exactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache KafkaExactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache Kafkaconfluent
 
Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Jeremy Edberg
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeperknowbigdata
 
Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014Konrad Malawski
 
Use case for using the ElastiCache for Redis in production
Use case for using the ElastiCache for Redis in productionUse case for using the ElastiCache for Redis in production
Use case for using the ElastiCache for Redis in production知教 本間
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Amazon Web Services
 
Kafka At Scale in the Cloud
Kafka At Scale in the CloudKafka At Scale in the Cloud
Kafka At Scale in the Cloudconfluent
 

Mais procurados (20)

Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServices
 
Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015Kafkaesque days at linked in in 2015
Kafkaesque days at linked in in 2015
 
KubeCon 2019 Recap (Parts 1-3)
KubeCon 2019 Recap (Parts 1-3)KubeCon 2019 Recap (Parts 1-3)
KubeCon 2019 Recap (Parts 1-3)
 
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
 
(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPC
(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPC(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPC
(CMP303) ResearchCloud: CfnCluster and Internet2 for Enterprise HPC
 
How Yelp does Service Discovery
How Yelp does Service DiscoveryHow Yelp does Service Discovery
How Yelp does Service Discovery
 
Boston hug
Boston hugBoston hug
Boston hug
 
Otimizando servidores web
Otimizando servidores webOtimizando servidores web
Otimizando servidores web
 
Reactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka StreamsReactive Stream Processing with Akka Streams
Reactive Stream Processing with Akka Streams
 
YARN
YARNYARN
YARN
 
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
Go Reactive: Event-Driven, Scalable, Resilient & Responsive SystemsGo Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
 
Breaking Spark: Top 5 mistakes to avoid when using Apache Spark in production
Breaking Spark: Top 5 mistakes to avoid when using Apache Spark in productionBreaking Spark: Top 5 mistakes to avoid when using Apache Spark in production
Breaking Spark: Top 5 mistakes to avoid when using Apache Spark in production
 
Exactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache KafkaExactly-once Semantics in Apache Kafka
Exactly-once Semantics in Apache Kafka
 
Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014Reactive Streams / Akka Streams - GeeCON Prague 2014
Reactive Streams / Akka Streams - GeeCON Prague 2014
 
Use case for using the ElastiCache for Redis in production
Use case for using the ElastiCache for Redis in productionUse case for using the ElastiCache for Redis in production
Use case for using the ElastiCache for Redis in production
 
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303...
 
Openstack summit 2015
Openstack summit 2015Openstack summit 2015
Openstack summit 2015
 
Kafka At Scale in the Cloud
Kafka At Scale in the CloudKafka At Scale in the Cloud
Kafka At Scale in the Cloud
 

Destaque

Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...
Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...
Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...Joao Galdino Mello de Souza
 
Conceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando FerreiraConceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando FerreiraJoao Galdino Mello de Souza
 
A relatividade das percepções na Application Performance Management (APM)
A relatividade das percepções na Application Performance Management (APM)A relatividade das percepções na Application Performance Management (APM)
A relatividade das percepções na Application Performance Management (APM)Joao Galdino Mello de Souza
 
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...Joao Galdino Mello de Souza
 
Performance Oriented Design
Performance Oriented DesignPerformance Oriented Design
Performance Oriented DesignRodrigo Campos
 

Destaque (6)

Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...
Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...
Modernização do Gerenciamento, Monitoramento e Provisionamento em Mainframes ...
 
Conceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando FerreiraConceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando Ferreira
 
A relatividade das percepções na Application Performance Management (APM)
A relatividade das percepções na Application Performance Management (APM)A relatividade das percepções na Application Performance Management (APM)
A relatividade das percepções na Application Performance Management (APM)
 
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
 
Agile or Fragile
Agile or FragileAgile or Fragile
Agile or Fragile
 
Performance Oriented Design
Performance Oriented DesignPerformance Oriented Design
Performance Oriented Design
 

Semelhante a Capacity Planning for fun & profit

First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNAFirst Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNATomas Cervenka
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterJohn Adams
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitterRoger Xia
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...smallerror
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...xlight
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010Christopher Brown
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the Worldjhugg
 
Hacklu2011 tricaud
Hacklu2011 tricaudHacklu2011 tricaud
Hacklu2011 tricaudstricaud
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedTim Callaghan
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDogRedis Labs
 
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor AppsLibrato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor AppsHeroku
 
Using Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comUsing Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comDamien Krotkine
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
Cloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using OpenstackCloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using OpenstackAndrew Yongjoon Kong
 
Performance and scalability with drupal
Performance and scalability with drupalPerformance and scalability with drupal
Performance and scalability with drupalRonan Berder
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupRafal Kwasny
 
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...Codemotion
 

Semelhante a Capacity Planning for fun & profit (20)

First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNAFirst Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
First Hive Meetup London 2012-07-10 - Tomas Cervenka - VisualDNA
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitter
 
Fixing_Twitter
Fixing_TwitterFixing_Twitter
Fixing_Twitter
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
 
Hacklu2011 tricaud
Hacklu2011 tricaudHacklu2011 tricaud
Hacklu2011 tricaud
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor AppsLibrato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
Librato's Joseph Ruscio at Heroku's 2013: Instrumenting 12-Factor Apps
 
Using Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comUsing Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.com
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
Cloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using OpenstackCloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using Openstack
 
Performance and scalability with drupal
Performance and scalability with drupalPerformance and scalability with drupal
Performance and scalability with drupal
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetup
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
Microservices in action at the Dutch National Police - Bert Jan Schrijver - C...
 

Mais de Rodrigo Campos

Velocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOpsVelocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOpsRodrigo Campos
 
DevOps no mundo real - QCON 2014
DevOps no mundo real - QCON 2014DevOps no mundo real - QCON 2014
DevOps no mundo real - QCON 2014Rodrigo Campos
 
7Masters Webops in the Cloud
7Masters Webops in the Cloud7Masters Webops in the Cloud
7Masters Webops in the CloudRodrigo Campos
 
Otimização holistica de ambiente computacional
Otimização holistica de ambiente computacionalOtimização holistica de ambiente computacional
Otimização holistica de ambiente computacionalRodrigo Campos
 
Desempenho e Escalabilidade de Banco de Dados em ambiente x86
Desempenho e Escalabilidade de Banco de Dados em ambiente x86Desempenho e Escalabilidade de Banco de Dados em ambiente x86
Desempenho e Escalabilidade de Banco de Dados em ambiente x86Rodrigo Campos
 
Mistério ou tecnologia? Paralelismo!
Mistério ou tecnologia? Paralelismo!Mistério ou tecnologia? Paralelismo!
Mistério ou tecnologia? Paralelismo!Rodrigo Campos
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance AnalysisRodrigo Campos
 
Sistemas de proteção de perímetro
Sistemas de proteção de perímetroSistemas de proteção de perímetro
Sistemas de proteção de perímetroRodrigo Campos
 
Devops at Walmart GeC Brazil
Devops at Walmart GeC BrazilDevops at Walmart GeC Brazil
Devops at Walmart GeC BrazilRodrigo Campos
 
Disk IO Benchmarking in shared multi-tenant environments
Disk IO Benchmarking in shared multi-tenant environmentsDisk IO Benchmarking in shared multi-tenant environments
Disk IO Benchmarking in shared multi-tenant environmentsRodrigo Campos
 
Cloud Computing Oportunidades e Desafios
Cloud Computing Oportunidades e DesafiosCloud Computing Oportunidades e Desafios
Cloud Computing Oportunidades e DesafiosRodrigo Campos
 
The good, the bad and the big... data
The good, the bad and the big... dataThe good, the bad and the big... data
The good, the bad and the big... dataRodrigo Campos
 
CMG 2012 - Tuning where it matters - Gerry Tuddenham
CMG 2012 - Tuning where it matters - Gerry TuddenhamCMG 2012 - Tuning where it matters - Gerry Tuddenham
CMG 2012 - Tuning where it matters - Gerry TuddenhamRodrigo Campos
 
A Consumerização da TI e o Efeito BYOT
A Consumerização da TI e o Efeito BYOTA Consumerização da TI e o Efeito BYOT
A Consumerização da TI e o Efeito BYOTRodrigo Campos
 
CMG Brasil 2012 - Uso de Lines nos z196
CMG Brasil 2012 - Uso de Lines nos z196CMG Brasil 2012 - Uso de Lines nos z196
CMG Brasil 2012 - Uso de Lines nos z196Rodrigo Campos
 
Racionalização e Otimização de Energia em Computação na Nuvem
Racionalização e Otimização de Energia em Computação na NuvemRacionalização e Otimização de Energia em Computação na Nuvem
Racionalização e Otimização de Energia em Computação na NuvemRodrigo Campos
 
SDN - Openflow + OpenVSwitch + Quantum
SDN - Openflow + OpenVSwitch + QuantumSDN - Openflow + OpenVSwitch + Quantum
SDN - Openflow + OpenVSwitch + QuantumRodrigo Campos
 

Mais de Rodrigo Campos (20)

Velocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOpsVelocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOps
 
DevOps no mundo real - QCON 2014
DevOps no mundo real - QCON 2014DevOps no mundo real - QCON 2014
DevOps no mundo real - QCON 2014
 
7Masters Webops in the Cloud
7Masters Webops in the Cloud7Masters Webops in the Cloud
7Masters Webops in the Cloud
 
14 guendert pres
14 guendert pres14 guendert pres
14 guendert pres
 
Large and Giant Pages
Large and Giant PagesLarge and Giant Pages
Large and Giant Pages
 
Otimização holistica de ambiente computacional
Otimização holistica de ambiente computacionalOtimização holistica de ambiente computacional
Otimização holistica de ambiente computacional
 
Desempenho e Escalabilidade de Banco de Dados em ambiente x86
Desempenho e Escalabilidade de Banco de Dados em ambiente x86Desempenho e Escalabilidade de Banco de Dados em ambiente x86
Desempenho e Escalabilidade de Banco de Dados em ambiente x86
 
13 coelho final-pres
13 coelho final-pres13 coelho final-pres
13 coelho final-pres
 
Mistério ou tecnologia? Paralelismo!
Mistério ou tecnologia? Paralelismo!Mistério ou tecnologia? Paralelismo!
Mistério ou tecnologia? Paralelismo!
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance Analysis
 
Sistemas de proteção de perímetro
Sistemas de proteção de perímetroSistemas de proteção de perímetro
Sistemas de proteção de perímetro
 
Devops at Walmart GeC Brazil
Devops at Walmart GeC BrazilDevops at Walmart GeC Brazil
Devops at Walmart GeC Brazil
 
Disk IO Benchmarking in shared multi-tenant environments
Disk IO Benchmarking in shared multi-tenant environmentsDisk IO Benchmarking in shared multi-tenant environments
Disk IO Benchmarking in shared multi-tenant environments
 
Cloud Computing Oportunidades e Desafios
Cloud Computing Oportunidades e DesafiosCloud Computing Oportunidades e Desafios
Cloud Computing Oportunidades e Desafios
 
The good, the bad and the big... data
The good, the bad and the big... dataThe good, the bad and the big... data
The good, the bad and the big... data
 
CMG 2012 - Tuning where it matters - Gerry Tuddenham
CMG 2012 - Tuning where it matters - Gerry TuddenhamCMG 2012 - Tuning where it matters - Gerry Tuddenham
CMG 2012 - Tuning where it matters - Gerry Tuddenham
 
A Consumerização da TI e o Efeito BYOT
A Consumerização da TI e o Efeito BYOTA Consumerização da TI e o Efeito BYOT
A Consumerização da TI e o Efeito BYOT
 
CMG Brasil 2012 - Uso de Lines nos z196
CMG Brasil 2012 - Uso de Lines nos z196CMG Brasil 2012 - Uso de Lines nos z196
CMG Brasil 2012 - Uso de Lines nos z196
 
Racionalização e Otimização de Energia em Computação na Nuvem
Racionalização e Otimização de Energia em Computação na NuvemRacionalização e Otimização de Energia em Computação na Nuvem
Racionalização e Otimização de Energia em Computação na Nuvem
 
SDN - Openflow + OpenVSwitch + Quantum
SDN - Openflow + OpenVSwitch + QuantumSDN - Openflow + OpenVSwitch + Quantum
SDN - Openflow + OpenVSwitch + Quantum
 

Último

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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
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
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Último (20)

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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
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...
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Capacity Planning for fun & profit

  • 1. Capacity Planning for fun & profit beyond cacti and top II São Paulo Perl Workshop Rodrigo Albani de Campos - @xinu camposr@gmail.com
  • 2. Agenda • Capacity planning primer: a tale of discovery • Metrics • Queues • Models
  • 3. Why Perl ? • Main reason: I feel comfortable with it • Ubiquitous and free • Plenty of stable statistics modules available at CPAN • Ultimately, it gets the job done
  • 4. Capacity Planning • Is just like sex... • Everyone wants to do it • Many say they’re doing it • You always exaggerate how much of it you’re doing • Most people aren’t actually doing it (despite their best efforts) • Everybody else seems to be doing more than you
  • 5. A tale of discovery There once was a system administrator...
  • 6. A tale of discovery How many ? Actual capacity ? Servers do we need ? How much memory ? What’s the predicted growth ? IO Capacity ?
  • 7. Typical Performance Metrics • Load Average - uptime • The single most misunderstood metric • CPU - mpstat • IO - iostat • Memory Usage - vmstat
  • 9. Time series charts I’m looking at you cacti huggers ! • Time series performance data is useful for: • Troubleshooting • Simplistic forecasting • Find trends • Identify seasonal behavior • This left alone is NOT Capacity Planning
  • 10. Frustration • Computer systems can be harsh • Most systems will not scale linearly • Diminishing returns and lock contention will punch you in the face • “Oh but I’ve checked cacti and the CPU was 25% idle”
  • 11. Let’s put it in the Cloud • We are moving back to an utility computing model • You’re charged per usage • Even more important to care about capacity planning !!!
  • 12. Call the experts • Cost per MIPS • IBM System/370 model 158-3 - 1.0 MIPS @ 1.0 MHz -1972 • Average purchase price: $ 771,000* • No disks or peripherals included • $ 4,082,039 by 2011 • Need to squeeze every drop of processing power * Source: http://www-03.ibm.com/ibm/history/exhibits/mainframe/mainframe_PP3135.html
  • 13. Queues The not so typical performance metrics • 1961 - CTSS was first demonstrated at MIT • 1965 - Allan Scherr used machine repairman problem to model a time-shared system as part of Project MAC • Another offspring of Project MAC is Multics
  • 14. Queues The not so typical performance metrics Computer System Disks CPU
  • 15. Queues The not so typical performance metrics (A) λ X (C) S Open/Closed W Network R A Arrival Count λ Arrival Rate (A/T) W Time spent in Queue R Residence Time (W+S) S Service Time X System Throughput (C/T) C Completed tasks count
  • 16. Arrival Rate (λ) • Pretty straightforward • Requests per second/hour/day • Not the same as throughput (X) • Although in a steady state: • A = C as T →∞ • λ=X
  • 17. Service Time (S) • Time spent in processing • Web server response time • Total query time • IO operation time length
  • 18. !"#$%&"'(%)"*+,' Mythical Performance !#)" !#(" !#'" • Not gonna happen... !"#$%&"'(%)"'*+,' !#&" *+,-./+"0.1+234" • Don’t believe vendor’s sales pitch !#%" • “In God we trust, all others must bring data” - William Edwards Deming !#$" !" !" (" $!" $(" %!" %(" &!" &(" '!" '(" -##%$./'0.1"'*2%1+3+,'
  • 19. Mythical Performance • Not gonna happen... • Don’t believe vendor’s sales pitch • “In God we trust, all others must bring data” - William Edwards Deming
  • 20. How to measure ? • Apache: %D in mod_log_config • nginx: $request_time in HttpLogModule • use Benchmark; • tcprstat - http://goo.gl/0cbYx • collectd - http://goo.gl/OXKG7 • metrics - http://goo.gl/gQFVM • sysstat - http://goo.gl/2aLul
  • 21. How to measure ? my ($date,$svctime) = (m/[(S+).+?s(d+)$/); $arrivalRate{$date}++; $serviceTimeAcc{$date} += $svctime; [02/Jul/2010:14:00:18... 1863 Time to serve the request, in μseconds.
  • 25. use Chart::Clicker; Average Hits/s = 65.142 Average Svc time = 0.0159
  • 26. use Chart::Clicker; Average Hits/s = 65.142 Average Svc time = 0.0159
  • 27. What to look for ? • Stretch factor • Method/Operation • Geolocation • Cookies • Use mod_logio to measure inbound traffic as well
  • 28. Modeling Prediction is very difficult, especially if it’s about the future. Niels Bohr Capacity planning is about setting expectations. Even wrong expectations are better than no expectations! Neil J. Gunther - The Guerrilla Manifesto http://goo.gl/lZKWH
  • 29. Modeling • A model is an abstraction of a complex system • A model allows us to observe phenomena that cannot be easily replicated
  • 30. Modeling Methods • Statistics / Trending / Forecasting • Pros: • Easy to understand • Tools readily available • Cons: • Hard to create “What-if” scenarios • Hard to predict contention and bottlenecks
  • 31. Modeling Methods • Queuing Analisys • Pros: • Allows you to make predictions when no production data is available • Allows you to create “What-if” scenarios • Cons: • Sometimes it can be unintuitive • The math behind it can be difficult
  • 32. Queues as models Typical LAMP Stack Clients Requests Replies Apache Application Database
  • 33. Queues as models What if ? Clients Requests Replies Cache Apache Application Database
  • 34. Queues as models What happens if we use a 15k RPM disk ? CPU Disk 10k RPM
  • 35. Queues as models m1.small ? m1.large ? m1.xlarge ? Virtual Cores X EC2 CU Memory Bus
  • 36. use pdq; • Available at http://goo.gl/s98wQ (not on CPAN) • PDQ is a queuing circuit solver by Neil J. Gunther • There’s a whole book about it http://goo.gl/9MA2c
  • 37. use pdq; CreateNode() Define a queuing center Define a traffic stream of an CreateOpen() open circuit Define a traffic stream of a CreateClosed() closed circuit Define the service demand for SetDemand() each of the queuing centers
  • 38. use pdq; Node Types CEN Queuing Center DLY Delay Center
  • 39. use pdq; Service Disciplines FCFS First-come first-served LCFS Last-come first-served ISRV Infinite Server PSHR Processor Sharing
  • 40. use pdq; • Apache Web Server • Average Network RTD: 0.00921 seconds • Added as a delay center in the circuit • Average Arrival Rate: 65.142 hits/s • Average Service time: 0.0159 seconds • 128 worker threads
  • 41. use pdq; $workload = "httpd"; $httpMaxClient = 128; pdq::Init("web server"); $arrivalRate = 65.142; $serviceTime = 0.1159; $pdq::streams = pdq::CreateOpen($workload, $arrivalRate);
  • 42. pdq::Report(); Metric Value Unit ------ ----- ---- Workload: "httpd" Number in system 8.0279 Trans Mean throughput 65.1420 Trans/Sec Response time 0.1232 Sec Stretch factor 1.0626
  • 43. pdq::Report(); Bounds Analysis: Max throughput 1104.4003 Trans/Sec Min response 0.1160 Sec
  • 44. pdq::Report(); • Average request size: 145 KBytes • ~ 1160 Kbits • @1104 transactions / second: • 1,280,640 Kbits /s ~ 1.28 Gbps
  • 45. Resources and References • CMG Public Proceedings: http://www.cmg.org/proceedings/ • Measure IT: http://www.cmg.org/measureit/ • Guerrilla Capacity Planning http://www.perfdynamics.com/Classes/ Outlines/guerilla.html
  • 46. Resources and References • Performance by Design - Menasce, Dowdy, Almeida - http://amzn.to/mpqfVO • Capacity Planning for Web Performance: Metrics, Models, and Methods - Daniel Menasce,Virgilio Almeida - http://amzn.to/ lOATba • Capacity Planning for Web Services: Metrics, Models, and Methods - Daniel Menasce, Virgilio Almeida - http://amzn.to/iClpsB
  • 47. Resources and References • Guerrilla Capacity Planning: A Tactical Approach to Planning for Highly Scalable Applications and Services - Neil Gunther - http://amzn.to/kfrfLK • The Art of Computer Systems Performance Analysis: Techniques for Experimental Design, Measurement, Simulation, and Modeling - R. K. Jain - http://amzn.to/jqud1I