Learning Cloud Dynamics to Optimize Spot Instance Bidding - - PowerPoint PPT Presentation

learning cloud dynamics to optimize spot instance bidding
SMART_READER_LITE
LIVE PREVIEW

Learning Cloud Dynamics to Optimize Spot Instance Bidding - - PowerPoint PPT Presentation

Learning Cloud Dynamics to Optimize Spot Instance Bidding Strategies Misha Khodak Joint with Liang Zheng, Andrew Lan, Carlee Joe-Wong, and Mung Chiang Overview The popularity of cloud computing services has led to the rise of dual-market


slide-1
SLIDE 1

Learning Cloud Dynamics to Optimize Spot Instance Bidding Strategies

Misha Khodak Joint with Liang Zheng, Andrew Lan, Carlee Joe-Wong, and Mung Chiang

slide-2
SLIDE 2

Overview

  • The popularity of cloud computing services has led to the rise of

dual-market pricing schemes:

  • Providers sell some instances at a fixed “on-demand” price.
  • Excess capacity is sold at a variable “spot-price” determined

via an auction.

  • We propose a nonlinear dynamical system model to understand

spot-price behavior in this environment.

  • We verify our model using five months of Amazon EC2 data and

demonstrate its potential to inform strategic bidding between heterogeneous cloud resources.

slide-3
SLIDE 3

The Amazon EC2 Spot Market

  • 1. Select the type of instance
  • 2. Configure and set a bid price
  • 3. Amazon sets a spot price
  • 4. User receives instance if bid was above spot price
slide-4
SLIDE 4

Motivation

  • Spot price dynamics are poorly understood, with past

economic modeling focusing mainly on global behavior:

  • Zheng et al. (SIGCOMM 2015) study the spot price

distribution at equilibrium.

  • Hoy et al. (WINE 2016) explain the optimality of a two-

market design as stemming from variable user risk aversion.

  • Understanding temporal dynamics can better inform

strategic bidding.

slide-5
SLIDE 5

Spot Price Observations

m3.medium spot price

  • ver 5 months in 2017

The spot price πt tends to hover above a constant lower bound price π. Sometimes goes above the on-demand price π. Occurs when on-demand users take up too much capacity.

slide-6
SLIDE 6

Provider Profit Maximization

  • n-demand

instances spot-market instances

  • n-demand profit

spot-market profit (π − π) N (d)

t

+ (πt − π) N (s)

t

Need a constraint on the number of instances (N):

  • Profit-Maximizing: N (d)

t

+ N (s)

t

≤ N

  • Usage-Maximizing: N (d)

t

+ N (s)

t

= N

slide-7
SLIDE 7

Maximize Profit or Usage?

Mar. Apr. May Jun. Jul. Aug. 0.10 0.08 0.06 0.04 0.02 0.00

Proposition [KZLJC’18]: If Bt bids are drawn independently from a distri- bution that weakly stochastically dominates the uniform distribution over [π, π], then if the provider uses the profit-maximizing constraint we have P ⇣ πt ≤ π(ρ)⌘ ≤ exp −2 ✓1 2 − 2ρ ◆2 Bt ! for ρ ∈ [0, 1/4] and π(ρ) = ρπ + (1 − ρ)π. So a profit-maximizing provider will not set πt close to π very often, which contradicts the data and motivates the choice of a usage-maximizing constraint:

slide-8
SLIDE 8

Observed Spot Price Model

At time t cloud provider sees Bt bids, which we model as being i.i.d. draws from U[π, π] (Zheng et al., 2015). Then in the limit Bt → ∞ this the spot price is distributed as πt = 8 < : π nt + bt ≤ 1 (not enough users) π − (π − π) 1−nt

bt

+ εt 0 < 1 − nt < bt π nt ≥ 1 (too many on-demand users) where we define: nt = N (d)

t

/N

  • n-demand usage

bt = Bt/N spot usage εt ∼ N ✓ 0, σ2 bt ◆

  • bservation noise
slide-9
SLIDE 9

Job Arrival and Departure

We model two hidden variables:

  • 1. nt, the number of running on-demand jobs at time t, normalized by N
  • 2. bt, the number of active spot bids at time t, normalized by N

At each time step, Λ(d)

t

  • n-demand jobs arrive, Λ(s)

t

spot jobs arrive, ˜ Λ(d)

t

  • n-

demand jobs complete, and ˜ Λ(s)

t

spot jobs complete. This yields the dynamical system nt+1 = nt + λ(d)

t

− ˜ λ(d)

t

bt+1 = bt + λ(s)

t

− ˜ λ(s)

t

for all λt = Λt/N modeled as i.i.d. draws from exponential distributions.

slide-10
SLIDE 10

Combined Model

Our spot price model is a hidden Markov model (HMM) with hidden state transition governed by the job arrival/departure model: nt+1 = nt + λ(d)

t

− ˜ λ(d)

t

bt+1 = bt + λ(s)

t

− ˜ λ(s)

t

and the spot price distribution: πt =    π nt + bt ≤ 1 π − (π − π) 1−nt

bt

+ εt 0 < 1 − nt < bt π nt ≥ 1 Five model parameters: a scale parameter for each exponentially-distributed λt for job arrival/departure and variance σ2 of the Gaussian observation noise εt.

  • bservation

hidden state

slide-11
SLIDE 11

Parameter Estimation

  • Model parameters and

hidden states are jointly estimated using Expectation-Maximization (EM).

  • The E-step is conducted

using a sequential Monte Carlo (“particle filter”) approach:

  • Better suited better

than Kalman-type filters for non-smooth, singular models.

  • Can handle hidden

state constraints.

date dollars dollars

  • no. of request (prop. of N)
  • no. of request (prop. of N)

prediction (95% conf.) prediction (95% conf.)

1.4 1.2 1.0 0.8 0.6 0.4 0.2 0.0 2.5 2.0 1.5 1.0 0.5 0.0 0.10 0.08 0.06 0.04 0.02 0.00 1.4 1.2 1.0 0.8 0.6 0.4 0.2 0.0

date

  • Feb. 19
  • Mar. 19
  • Apr. 16
  • Feb. 19
  • Mar. 19
  • Apr. 16

date

  • Feb. 19
  • Mar. 19
  • Apr. 16

date

  • Feb. 19
  • Mar. 19
  • Apr. 16

m3.medium, spring 2017 g2.2xlarge, spring 2017

slide-12
SLIDE 12

Strategic Bidding

  • We consider the setting where we want to start a job immediately.
  • In the single-instance setting, the optimal strategy is to bid the on-

demand price, if one can afford it.

  • Instead we can bid within a class of instances by assuming jobs

can be easily parallelized.

family of compute-

  • ptimized

instances price scales linearly with resources

slide-13
SLIDE 13

Choosing Between Instance Families

Given a price π(i)

τ

at time τ for each instance type i in a family I of instances, we wish to minimize the instance cost: P (i)

τ

=

t+Ti

X

t=τ+1

π(i)

t

for Ti the amount of time it takes to finish a job on type i.

  • Solved by using a spot-price model to find iτ = arg min Eπ(i)

τ P (i)

τ .

  • In experiments we assume jobs that can be run completely in parallel.
  • Can be extended to bidding on non perfectly-parallel jobs and strategic

bidding across geographic regions.

slide-14
SLIDE 14

Expected Instance Cost: Leveraging Our Model

  • Simulation: use learned parameters to compute the expected

instance cost by simulating multiple trajectories.

  • Requires a lot of computation for high accuracy.
  • Empirically useful on shorter job lengths.
  • Approximation: approximate the expected instance cost

using a second-order Taylor expansion.

  • Cheap to compute.
  • Empirically useful on longer timescales.
  • Assumes the job arrival/departure rates are about the same

in both the on-demand and spot market (empirically true).

slide-15
SLIDE 15

Expected Instance Cost: Linear Auto-Regression

  • Baseline AR(p)

model - the price at each time step is some noisy linear combination of the price at p previous time steps.

  • Data does not satisfy

standard Gaussian error assumptions and uncorrelated residuals.

  • 0.04
  • 0.02

0.00 0.02 0.04 0.04 0.02 0.00

  • 0.02
  • 0.04
  • 0.04
  • 0.02

0.00 0.02 0.04 0.04 0.02 0.00

  • 0.02
  • 0.04
  • 0.005

0.000 0.005 600 500 400 300 200 100

  • 0.005

0.000 0.005 0.010 600 500 400 300 200 100

AR(1) AR(17)

slide-16
SLIDE 16

Evaluating Bidding Strategies

  • The performance of each bidding strategy is evaluated using

regret: the difference between the cost of the chosen action and that of the best action in hindsight.

  • Model-based methods succeed especially well on shorter-

term (e.g. 16-hour) jobs.

Regret (US Cents)

1 2 3 4

Instance Type

m3 c3 r3 i3 g2( /20)

Monte Carlo Approximation Linear Auto-Regression

Regret (US Cents)

2.5 5 7.5 10

Instance Type

m3 c3 r3 i3 g2( /100)

Monte Carlo Approximation Linear Auto-Regression

16 Hours 64 Hours

slide-17
SLIDE 17

Performance and Volatility

  • Model is consistently better than AR on more volatile instances.
  • More monetary gain to be had from strategic bidding.
  • More overlap between the realized cost distributions of

different instances.

0.3 0.4 0.5 0.6 Probability Density 1.0 1.5 2.0 0.5 Probability Density 0.6 0.8 1.0 1.2 1.4 Probability Density 0.5 1.0 1.5 2.0 Probability Density 10 20 30 40 50 Probability Density

Volatile Instances (g2, i3) Non-Volatile Instances (m3, c3, r3)

Payment Distribution for Different Instances

slide-18
SLIDE 18

Summary

  • We model spot-pricing in cloud computing as a

nonlinear dynamical system.

  • Amazon EC2 data was used to analyze the

problem and learn model parameters.

  • We describe strategies for strategic bidding

between instances that can make use of the model.

slide-19
SLIDE 19

Open Questions

  • How do we examine the problem in the setting

where dynamics can be influenced across instance families or different regions?

  • Provide a model for job departure that explicitly

depends on the recent job arrival random variables.

  • Devise more sophisticated bidding strategies

requiring lighter assumptions concerning job parallelism.

slide-20
SLIDE 20

Thank you!

Questions? Contact e-mail: mkhodak@princeton.edu