SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Decision	
  Support	
  for	
  Amazon	
  
                    EC2	
  Spot	
  Instances	
  
                              Fei	
  Dong	
  
                             2011-­‐11-­‐28	
  



11/27/11	
                                                1	
  
A	
  Glimpse	
  of	
  Amazon	
  EC2	
  
•  Reserved	
  Instance,	
  On-­‐demand	
  Instance,	
  and	
  SI	
  
•  Different	
  scenarios:	
  Cluster	
  ×	
  Workload	
  
     EC2	
  Node	
         CPU	
         Memory           I/O	
      Per-­‐hour	
  
       Type            (#EC2	
  units)               Performance       Cost
  m1.small                   1           1.7	
  GB    moderate        $0.085
  m1.large                   4           7.5	
  GB       high          $0.34
  m1.xlarge                  8           15	
  GB        high          $0.68
  c1.medium                  5           1.7	
  GB    moderate         $0.17
  c1.xlarge                 20            7	
  GB        high          $0.68
  cc1.4xlarge              33.5          23	
  GB     very	
  high     $1.60


 11/27/11	
                                                                           2	
  
MulU-­‐objecUve	
  Cluster	
  Provisioning	
  
               1,200
Running Time


               1,000
                 800
   (min)



                 600                                                       Actual
                 400
                 200
                   0
                       m1.small   m1.large m1.xlarge c1.medium c1.xlarge
               10.00
                8.00
    Cost ($)




                6.00
                4.00                                                       Actual
                2.00
                0.00
                       m1.small   m1.large m1.xlarge c1.medium c1.xlarge
                            EC2 Instance Type for Target Cluster

11/27/11	
                                                                          3	
  
Spot	
  Instance	
  
•  Spot	
  instances	
  enable	
  you	
  to	
  bid	
  for	
  unused	
  
   Amazon	
  EC2	
  capacity.	
  Instances	
  are	
  charged	
  
   the	
  Spot	
  Price	
  which	
  is	
  set	
  by	
  Amazon	
  EC2	
  and	
  
   fluctuates	
  periodically	
  depending	
  on	
  the	
  
   supply	
  of	
  and	
  demand	
  for	
  Spot	
  Instance	
  
   capacity.	
  




11/27/11	
                                                                   4	
  
Challenges	
  &	
  AssumpUons	
  
•  Challenges:	
  
        –  Minimize	
  monetary	
  costs	
  for	
  a	
  user	
  while	
  meeUng	
  
           Service	
  constrains.	
  
        –  Know	
  nothing	
  about	
  Amazon	
  pricing	
  strategy	
  and	
  
           other	
  bid	
  strategy.	
  

•  AssumpUons:	
  
        –  Bid	
  price	
  is	
  fixed.	
  
        –  Instance	
  Type	
  is	
  fixed	
  (no	
  mix	
  strategy)	
  
        –  Not	
  consider	
  the	
  overhead	
  to	
  recover	
  spot	
  instances.	
  

11/27/11	
                                                                                 5	
  
Pricing	
  PredicUon	
  Model	
  
•  Linear	
  Regression	
  
•  Normal	
  DistribuUon	
  
•  ExponenUal	
  DistribuUon	
  
      n
	
   ∑ p (1− p )i −1 (i )
                      H
               i =1




11/27/11	
                                                6	
  
Predict	
  Price	
  Algorithm	
  
1.  Collect	
  the	
  prices	
  over	
  a	
  period	
  of	
  Ume,	
  in	
  
    order	
  to	
  esUmate	
  mean	
  and	
  variance.	
  
2.  Use	
  the	
  exponenUal	
  approximaUon	
  fidng,	
  
    calculate	
  x	
  given	
  the	
  CDF(X<x)	
  =	
  Prob.	
  	
  
3.  Compare	
  other	
  models	
  and	
  pick	
  a	
  maximum	
  
    value	
  as	
  a	
  bid	
  price.	
  
4.  If	
  the	
  bid	
  price	
  is	
  smaller	
  than	
  the	
  spot	
  price,	
  
    thus	
  increase	
  the	
  bid	
  by	
  33%	
  for	
  the	
  next	
  
    interval.	
  
11/27/11	
                                                                            7	
  
Price	
  PredicUon	
  
                                                                             eu	
  linux.m1.small	
  spot	
  price	
  on	
  11/18/2011	
  
                   0.35	
  


                    0.3	
  


                   0.25	
  


                    0.2	
  
Price	
  ($)	
  




                                                                                                                                                                                                                                         Actual	
  

                   0.15	
                                                                                                                                                                                                                Predict	
  Adjust	
  

                                                                                                                                                                                                                                         Predict	
  
                     0.1	
  


                   0.05	
  


                        0	
  
                                1	
     2	
     3	
      4	
     5	
     6	
     7	
      8	
     9	
     10	
     11	
   12	
     13	
     14	
     15	
   16	
     17	
     18	
     19	
   20	
     21	
   22	
     23	
     24	
  
                                                                                                                       Time	
  (Hours)	
  


                                                        Var(Predict	
  Adj)	
  =	
  0.000769	
  
                   11/27/11	
                           Var(Predict)	
  	
  	
  	
  	
  	
  	
  	
  =	
  0.001786	
                                                                                                                                    8	
  
Bid	
  Strategy	
  
               Utility = F(d, b, e, t, n)                       Deadline d, budget b,
                                                                 Estimated Time e,
                copt = arg max F(d, b, e, t, n)
                           c∈S                                    Cluster Type t,
                                                                     Number n

        Min	
  Time	
  Mode:	
  Can	
  the	
  job	
  be	
  execute	
  as	
  soon	
  as	
  
        possible	
  under	
  specified	
  budget	
  and	
  deadline	
  
        constrains?	
  
        Min	
  Money	
  Mode:	
  	
  What	
  is	
  the	
  bid	
  price	
  and	
  instance	
  
        type	
  that	
  minimize	
  the	
  total	
  monetary	
  cost?	
  
                                                                                   ExhausUve	
  
                                                                                     Search	
  
11/27/11	
                                                                                         9	
  
Experimental	
  EvaluaUon	
  
•  Choose	
  5	
  Spot	
  Instance	
  Types	
  
        –  M1.small,	
  m1.large,	
  m1.xlarge,	
  c1.medium,	
  
           c1.xlarge	
  
•  Run	
  5	
  Instances	
  compared	
  with	
  on	
  demand	
  
   instances.	
  




11/27/11	
                                                          10	
  
Experimental	
  EvaluaUon	
  (Ctd.)	
  	
  
                                              1600	
  
                                              1400	
  
               Running	
  Time	
  (Min)	
  


                                              1200	
  
                                              1000	
  
                                               800	
                                                                                                                 on-­‐demand	
  
                                               600	
                                                                                                                 SI	
  budget	
  intensive	
  
                                               400	
  
                                                                                                                                                                     SI	
  Ume	
  intensive	
  
                                               200	
  
                                                       0	
  
                                                                m1.small	
     m1.large	
            m1.xlarge	
             c1.medium	
          c1.xlarge	
  
                                                                                               EC2	
  Instance	
  Type	
  


                                                      14	
  
                                                      12	
  
                                                      10	
  
                                    Cost	
  ($)	
  




                                                        8	
  
                                                                                                                                                                     on-­‐demand	
  
                                                        6	
  
                                                                                                                                                                     SI	
  budget	
  intensive	
  
                                                        4	
  
                                                                                                                                                                     SI	
  Ume	
  intensive	
  
                                                        2	
  
                                                        0	
  
                                                                m1.small	
      m1.large	
             m1.xlarge	
                c1.medium	
        c1.xlarge	
  
                                                                                                EC2	
  	
  Instance	
  Type	
  


11/27/11	
                                                                                                                                                                                           11	
  
Case	
  Analysis	
  
                 M1.small	
  Linux	
  on	
  11/18/2011	
  




               M1.small	
  spot	
  instance,	
  bid	
  strategy	
  
11/27/11	
                                                            12	
  
Conclusions	
  &	
  Future	
  Work	
  
•  Conclusions
        –  More cost-efficient than fixed-size instance choice
        –  Spot Instances not always provide inexpensive resources
           for transient workloads


•  Future works
        –  Consider to mix other instance types (e.g. spot
           instances & reserved instances)
        –  Disaster Recovery, checking point.


11/27/11	
                                                           13	
  
Reference	
  
•  hjp://aws.amazon.com/ec2/instance-­‐types	
  
•  H.	
  Herodotou,	
  F.	
  Dong,	
  and	
  S.	
  Babu.	
  No	
  One	
  (Cluster)	
  Size	
  Fits	
  All:	
  
     AutomaUc	
  Cluster	
  Sizing	
  for	
  Data-­‐intensive	
  AnalyUcs.	
  (Slides)In	
  Proc.	
  of	
  
     the	
  ACM	
  Symposium	
  on	
  Cloud	
  CompuUng	
  2011	
  (SOCC	
  '11),	
  October	
  2011.	
  
•  D.	
  Ardagna,	
  B.	
  Panicucci	
  and	
  M.Passacantando.	
  A	
  Game	
  TheoreUc	
  
     FormulaUon	
  of	
  the	
  Service	
  Provisioning	
  Problem	
  in	
  Cloud	
  Systems.	
  
     WWW2011	
  Proceedings,	
  2011	
  
•  N.	
  Jain,	
  I.	
  Menache,	
  and	
  O.	
  Shamir.	
  On-­‐demand	
  or	
  Spot?	
  Learning-­‐based	
  
     Resource	
  AllocaUon	
  for	
  Delay-­‐Tolerant	
  Batch	
  CompuUng.	
  	
  
	
  




11/27/11	
                                                                                                  14	
  
 
               Thank	
  youJ	
  



11/27/11	
                          15	
  

Weitere ähnliche Inhalte

Ähnlich wie Decision support for Amazon Spot Instance

Decision support for Amazon Spot Instance
Decision support for Amazon Spot InstanceDecision support for Amazon Spot Instance
Decision support for Amazon Spot InstanceFei Dong
 
Operating MongoDB in the Cloud
Operating MongoDB in the CloudOperating MongoDB in the Cloud
Operating MongoDB in the CloudMongoDB
 
Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot Amazon Web Services
 
Optimizing Your Infrastructure Costs on AWS
Optimizing Your Infrastructure Costs on AWSOptimizing Your Infrastructure Costs on AWS
Optimizing Your Infrastructure Costs on AWSAmazon Web Services
 
Optimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot InstancesOptimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot InstancesAmazon Web Services
 
Cloud Economics: Optimising for Cost
Cloud Economics: Optimising for CostCloud Economics: Optimising for Cost
Cloud Economics: Optimising for CostAmazon Web Services
 
SBSI optimization tutorial
SBSI optimization tutorialSBSI optimization tutorial
SBSI optimization tutorialRichard Adams
 
Performance and Availability Tradeoffs in Replicated File Systems
Performance and Availability Tradeoffs in Replicated File SystemsPerformance and Availability Tradeoffs in Replicated File Systems
Performance and Availability Tradeoffs in Replicated File Systemspeterhoneyman
 
[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...
[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...
[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...npinto
 
Cs264 intro-to-cloud-computing
Cs264 intro-to-cloud-computingCs264 intro-to-cloud-computing
Cs264 intro-to-cloud-computingkartiko edhi
 
Progress reports 2010.7.15
Progress reports 2010.7.15Progress reports 2010.7.15
Progress reports 2010.7.15lau
 
Value of Electric Vehicle Coordination
Value of Electric Vehicle CoordinationValue of Electric Vehicle Coordination
Value of Electric Vehicle Coordinationjondonadee
 
Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...
Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...
Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...Amazon Web Services
 
Rails in the Cloud - Experiences from running on EC2
Rails in the Cloud - Experiences from running on EC2Rails in the Cloud - Experiences from running on EC2
Rails in the Cloud - Experiences from running on EC2Jonathan Weiss
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der PraxisJonathan Weiss
 

Ähnlich wie Decision support for Amazon Spot Instance (20)

Decision support for Amazon Spot Instance
Decision support for Amazon Spot InstanceDecision support for Amazon Spot Instance
Decision support for Amazon Spot Instance
 
Operating MongoDB in the Cloud
Operating MongoDB in the CloudOperating MongoDB in the Cloud
Operating MongoDB in the Cloud
 
Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot
 
Introduction to Amazon EC2 Spot
Introduction to Amazon EC2 SpotIntroduction to Amazon EC2 Spot
Introduction to Amazon EC2 Spot
 
Venture financeproject1
Venture financeproject1Venture financeproject1
Venture financeproject1
 
Optimizing Your Infrastructure Costs on AWS
Optimizing Your Infrastructure Costs on AWSOptimizing Your Infrastructure Costs on AWS
Optimizing Your Infrastructure Costs on AWS
 
Optimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot InstancesOptimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot Instances
 
Cloud Economics: Optimising for Cost
Cloud Economics: Optimising for CostCloud Economics: Optimising for Cost
Cloud Economics: Optimising for Cost
 
SBSI optimization tutorial
SBSI optimization tutorialSBSI optimization tutorial
SBSI optimization tutorial
 
Performance and Availability Tradeoffs in Replicated File Systems
Performance and Availability Tradeoffs in Replicated File SystemsPerformance and Availability Tradeoffs in Replicated File Systems
Performance and Availability Tradeoffs in Replicated File Systems
 
[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...
[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...
[Harvard CS264] 08a - Cloud Computing, Amazon EC2, MIT StarCluster (Justin Ri...
 
Cs264 intro-to-cloud-computing
Cs264 intro-to-cloud-computingCs264 intro-to-cloud-computing
Cs264 intro-to-cloud-computing
 
Running on Amazon EC2
Running on Amazon EC2Running on Amazon EC2
Running on Amazon EC2
 
Progress reports 2010.7.15
Progress reports 2010.7.15Progress reports 2010.7.15
Progress reports 2010.7.15
 
Value of Electric Vehicle Coordination
Value of Electric Vehicle CoordinationValue of Electric Vehicle Coordination
Value of Electric Vehicle Coordination
 
Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...
Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...
Optimizing for Cost in the AWS Cloud - 5 Ways to Further Save - AWS Summit 20...
 
Rails in the Cloud
Rails in the CloudRails in the Cloud
Rails in the Cloud
 
Rails in the Cloud - Experiences from running on EC2
Rails in the Cloud - Experiences from running on EC2Rails in the Cloud - Experiences from running on EC2
Rails in the Cloud - Experiences from running on EC2
 
Optimizing for Costs in the Cloud
Optimizing for Costs in the CloudOptimizing for Costs in the Cloud
Optimizing for Costs in the Cloud
 
Amazon EC2 in der Praxis
Amazon EC2 in der PraxisAmazon EC2 in der Praxis
Amazon EC2 in der Praxis
 

Decision support for Amazon Spot Instance

  • 1. Decision  Support  for  Amazon   EC2  Spot  Instances   Fei  Dong   2011-­‐11-­‐28   11/27/11   1  
  • 2. A  Glimpse  of  Amazon  EC2   •  Reserved  Instance,  On-­‐demand  Instance,  and  SI   •  Different  scenarios:  Cluster  ×  Workload   EC2  Node   CPU   Memory I/O   Per-­‐hour   Type (#EC2  units) Performance Cost m1.small 1 1.7  GB moderate $0.085 m1.large 4 7.5  GB high $0.34 m1.xlarge 8 15  GB high $0.68 c1.medium 5 1.7  GB moderate $0.17 c1.xlarge 20 7  GB high $0.68 cc1.4xlarge 33.5 23  GB very  high $1.60 11/27/11   2  
  • 3. MulU-­‐objecUve  Cluster  Provisioning   1,200 Running Time 1,000 800 (min) 600 Actual 400 200 0 m1.small m1.large m1.xlarge c1.medium c1.xlarge 10.00 8.00 Cost ($) 6.00 4.00 Actual 2.00 0.00 m1.small m1.large m1.xlarge c1.medium c1.xlarge EC2 Instance Type for Target Cluster 11/27/11   3  
  • 4. Spot  Instance   •  Spot  instances  enable  you  to  bid  for  unused   Amazon  EC2  capacity.  Instances  are  charged   the  Spot  Price  which  is  set  by  Amazon  EC2  and   fluctuates  periodically  depending  on  the   supply  of  and  demand  for  Spot  Instance   capacity.   11/27/11   4  
  • 5. Challenges  &  AssumpUons   •  Challenges:   –  Minimize  monetary  costs  for  a  user  while  meeUng   Service  constrains.   –  Know  nothing  about  Amazon  pricing  strategy  and   other  bid  strategy.   •  AssumpUons:   –  Bid  price  is  fixed.   –  Instance  Type  is  fixed  (no  mix  strategy)   –  Not  consider  the  overhead  to  recover  spot  instances.   11/27/11   5  
  • 6. Pricing  PredicUon  Model   •  Linear  Regression   •  Normal  DistribuUon   •  ExponenUal  DistribuUon   n   ∑ p (1− p )i −1 (i ) H i =1 11/27/11   6  
  • 7. Predict  Price  Algorithm   1.  Collect  the  prices  over  a  period  of  Ume,  in   order  to  esUmate  mean  and  variance.   2.  Use  the  exponenUal  approximaUon  fidng,   calculate  x  given  the  CDF(X<x)  =  Prob.     3.  Compare  other  models  and  pick  a  maximum   value  as  a  bid  price.   4.  If  the  bid  price  is  smaller  than  the  spot  price,   thus  increase  the  bid  by  33%  for  the  next   interval.   11/27/11   7  
  • 8. Price  PredicUon   eu  linux.m1.small  spot  price  on  11/18/2011   0.35   0.3   0.25   0.2   Price  ($)   Actual   0.15   Predict  Adjust   Predict   0.1   0.05   0   1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   Time  (Hours)   Var(Predict  Adj)  =  0.000769   11/27/11   Var(Predict)                =  0.001786   8  
  • 9. Bid  Strategy   Utility = F(d, b, e, t, n) Deadline d, budget b, Estimated Time e, copt = arg max F(d, b, e, t, n) c∈S Cluster Type t, Number n Min  Time  Mode:  Can  the  job  be  execute  as  soon  as   possible  under  specified  budget  and  deadline   constrains?   Min  Money  Mode:    What  is  the  bid  price  and  instance   type  that  minimize  the  total  monetary  cost?   ExhausUve   Search   11/27/11   9  
  • 10. Experimental  EvaluaUon   •  Choose  5  Spot  Instance  Types   –  M1.small,  m1.large,  m1.xlarge,  c1.medium,   c1.xlarge   •  Run  5  Instances  compared  with  on  demand   instances.   11/27/11   10  
  • 11. Experimental  EvaluaUon  (Ctd.)     1600   1400   Running  Time  (Min)   1200   1000   800   on-­‐demand   600   SI  budget  intensive   400   SI  Ume  intensive   200   0   m1.small   m1.large   m1.xlarge   c1.medium   c1.xlarge   EC2  Instance  Type   14   12   10   Cost  ($)   8   on-­‐demand   6   SI  budget  intensive   4   SI  Ume  intensive   2   0   m1.small   m1.large   m1.xlarge   c1.medium   c1.xlarge   EC2    Instance  Type   11/27/11   11  
  • 12. Case  Analysis   M1.small  Linux  on  11/18/2011   M1.small  spot  instance,  bid  strategy   11/27/11   12  
  • 13. Conclusions  &  Future  Work   •  Conclusions –  More cost-efficient than fixed-size instance choice –  Spot Instances not always provide inexpensive resources for transient workloads •  Future works –  Consider to mix other instance types (e.g. spot instances & reserved instances) –  Disaster Recovery, checking point. 11/27/11   13  
  • 14. Reference   •  hjp://aws.amazon.com/ec2/instance-­‐types   •  H.  Herodotou,  F.  Dong,  and  S.  Babu.  No  One  (Cluster)  Size  Fits  All:   AutomaUc  Cluster  Sizing  for  Data-­‐intensive  AnalyUcs.  (Slides)In  Proc.  of   the  ACM  Symposium  on  Cloud  CompuUng  2011  (SOCC  '11),  October  2011.   •  D.  Ardagna,  B.  Panicucci  and  M.Passacantando.  A  Game  TheoreUc   FormulaUon  of  the  Service  Provisioning  Problem  in  Cloud  Systems.   WWW2011  Proceedings,  2011   •  N.  Jain,  I.  Menache,  and  O.  Shamir.  On-­‐demand  or  Spot?  Learning-­‐based   Resource  AllocaUon  for  Delay-­‐Tolerant  Batch  CompuUng.       11/27/11   14  
  • 15.   Thank  youJ   11/27/11   15