Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deploy in the cloud

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Deploy in the cloud

Avatar for Pablo Cantero

Pablo Cantero

June 21, 2013

More Decks by Pablo Cantero

Other Decks in Programming

Transcript

  1. $  git  pull $  git  checkout  production $  git  rebase

     master $  git  push  origin  production
  2. WARNING... As a programer the next slides with commands would

    appear beautiful, but don’t trust them, they can be very dangerous
  3. as-­‐create-­‐auto-­‐scaling-­‐group  my_autoscale_group      -­‐-­‐availability-­‐zones  us-­‐east-­‐1X      -­‐-­‐launch-­‐configuration  my_autoscale_config

         -­‐-­‐min-­‐size  1      -­‐-­‐max-­‐size  3      -­‐-­‐load-­‐balancers  my_load_balancer_name      -­‐-­‐health-­‐check-­‐type  ELB      -­‐-­‐grace-­‐period  300
  4. mon-­‐put-­‐metric-­‐alarm  AlarmName        -­‐-­‐comparison-­‐operator    value    

       -­‐-­‐evaluation-­‐periods    value    -­‐-­‐metric-­‐name    value        -­‐-­‐namespace    value        -­‐-­‐period    value        -­‐-­‐statistic  value        -­‐-­‐threshold    value      [-­‐-­‐actions-­‐enabled  value  ]      [-­‐-­‐alarm-­‐actions  value[,value...]  ]      [-­‐-­‐alarm-­‐description  value  ]      [-­‐-­‐dimensions   "key1=value1,key2=value2..."  ]      [-­‐-­‐ok-­‐actions  value[,value...]  ]      [-­‐-­‐unit  value  ]      [-­‐-­‐insufficient-­‐data-­‐actions     value[,value...]  ]
  5. require  "aws-­‐sdk" class  QueueSizeMetric    def  initialize      

     AWS.config  access_key_id:  "…",  secret_access_key:  "…"      end    def  put        metric  =  AWS::CloudWatch::Metric.new  "Worker",   "QueueSize"        size      =  SidekiqMetric.new.queue_size        metric.put_data  [{value:  size}]    end end
  6. 10 instances per 10 hours costs the same as 100

    instances per 1 hour Rules in the Cloud