Playing Games In The Clouds

Playing Games In The Clouds

What does haggling at a garage sale have to do with load balancing in distributed systems? How does bidding in an art auction relate to cloud service orchestration? Familiarity with the ideas and technologies involved in cloud computing is becoming ever more important for developers. This talk will demonstrate how you can use game theory — the study of strategic decision making — to design more efficient, and innovative, distributed systems.

A talk at RailsConf, GORUCO, and Brighton Ruby 2015.

5bace0ba91ff3182c0e522ab4d67cd56?s=128

Nadia Odunayo

April 22, 2015
Tweet

Transcript

  1. 2.
  2. 3.
  3. 6.

    –John von Neumann “Real life consists of bluffing, of little

    tactics of deception, of asking yourself what is the other man going to think I mean to do. And that is what games are about in my theory.”
  4. 7.

    1. Instructions 2. GAME ONE : Bargaining 3. GAME TWO

    : Auction 4. ADAPTING the Rules 5. Game over
  5. 8.

    1. Instructions 2. GAME ONE : Bargaining 3. GAME TWO

    : Auction 4. ADAPTING the Rules 5. Game over
  6. 14.

    1. Instructions 2. GAME ONE : Bargaining 3. GAME TWO

    : Auction 4. ADAPTING the Rules 5. Game over
  7. 15.
  8. 17.

    Gemma gets all of the sweets You get all of

    the sweets The bag of sweets is split in half between you and Gemma Gemma’s payoff Your payoff Payoff set 0,0 Nash bargaining solution point
  9. 19.

    We can use Bargaining Theory to think about how resources

    should be allocated within a distributed system.
  10. 21.

    HOW CAN WE MODEL THIS? 
 
 I can complete

    5 jobs every second! Oh! I can only complete 2. :-(
  11. 23.

    HOW CAN WE MODEL THIS? 
 
 I got 4

    jobs!! WAT?! :-( Yay! Only 1 job to do!
  12. 26.

    We want to distribute the jobs in such a way

    that optimally minimises overall execution time.
  13. 27.

    Each computer has the following payoff (happiness) function: log(x -

    y) Computer’s job processing rate Rate of jobs arriving at computer THE PROBLEM
  14. 29.

    The function we want to maximise is: THE PROBLEM yA+

    yB = 4 where log(5 - yA) + log(2 - yB) Computer A’s job processing rate Rate of jobs arriving at computer A Computer B’s job processing rate Rate of jobs arriving at computer B
  15. 30.

    THE SOLUTION log(5 - yA) + log(2 - yB) Jobs

    to send to computer A Total happiness 3.5
  16. 32.

    Computer B’s payoff Computer A’s payoff Payoff set 0,0 Nash

    Bargaining Solution point 3.5 jobs to computer A, 0.5 jobs to computer B Optimal response time = 1.33s yA = 3.8 jobs/sec yB = 0.2 jobs/sec Response time = 1.39s yA = 3.3 jobs/sec yB = 0.7 jobs/sec Response time = 1.36s THE SOLUTION
  17. 33.

    A NASH BARGAINING SOLUTION Approaching load balancing with Game Theory

    leads us to Nash Bargaining solutions. We can use the results to develop algorithms that dynamically and efficiently distribute jobs.
  18. 34.

    1. Instructions 2. GAME ONE : Bargaining 3. GAME TWO

    : Auction 4. ADAPTING the Rules 5. Game over
  19. 35.
  20. 36.
  21. 39.

    A strategy is dominant if that strategy gives the player

    their highest possible payoff regardless of what the other players do.
  22. 40.

    It is the dominant strategy to bid truthfully in a

    second-price auction. $5 mark $25 lucy $10 Helen Payoff = true value - b2 $15 $0 $0
  23. 41.

    It is the dominant strategy for agents to bid truthfully

    in a second- price auction. $5 mark $25 lucy $10 Helen $0 $-16 $0 $5 mark $25 lucy $26 Helen Payoff = true value - b2 $15 $0 $0 Payoff = true value - b2
  24. 42.

    We can use Auction Theory to reveal the resource capabilities

    of machines within a distributed system.
  25. 44.

    HOW CAN WE MODEL THIS? 
 
 I have lots

    of memory, but I’m not telling anyone! I can’t remember a thing! :-(
  26. 45.

    HOW CAN WE MODEL THIS? 
 
 I’ve got like

    5GB of memory… I honestly have just 1GB…
  27. 46.

    HOW CAN WE MODEL THIS? 
 
 Why have I

    got to run all of the jobs? Yay! No work to do!
  28. 49.

    THE PROBLEM Let’s focus on the computer A’s payoff: 15GB

    If a bid is not submitted, the payoff is 0.
  29. 51.

    THE PROBLEM Let’s focus on the computer A’s payoff: 15GB

    If bidA > bidB, the payoff to computer A is 15 − bidB.
  30. 52.

    THE SOLUTION It is the dominant strategy for the computers

    to truthfully report their capabilities. 15GB bidA = 15
  31. 53.

    THE SOLUTION 7 bidA = 15 bidB = 8 7

    bidA = 15 Payoff = 0 bidB = 17 15 bidA = 20 -2 bidB = 17 15 bidA = 20 bidB = 8 7 Payoff 15 − bidB.
  32. 54.

    THE SOLUTION 7 bidA = 15 Payoff = 0 bidB

    = 17 15 bidA = 11 bidB = 17 Payoff = 0 bidA = 15 bidB = 8 7 15 bidA = 6 bidB = 8 Payoff = 0 Payoff 15 − bidB.
  33. 56.

    OPTIMAL JOB PLACEMENT Auction frameworks enable us to develop algorithms

    that distribute jobs based on accurate representations of the resources available in a system.
  34. 57.

    1. Instructions 2. GAME ONE : Bargaining 3. GAME TWO

    : Auction 4. ADAPTING the Rules 5. Game over
  35. 58.
  36. 59.

    -0.7 jobs 2.3 jobs 5.3 jobs ALLOCATION ALGORITHM A
 8

    jobs/sec
 B
 5 jobs/sec
 C
 2 jobs/sec
 T = 7 jobs/sec Source: Grosu - Load Balancing In Distributed Systems: A Game Theoretic Approach
  37. 60.

    0 2 jobs 5 jobs ALLOCATION ALGORITHM A
 8 jobs/sec


    B
 5 jobs/sec
 C
 2 jobs/sec
 T = 7 jobs/sec Source: Grosu - Load Balancing In Distributed Systems: A Game Theoretic Approach
  38. 62.

    I want three application instances. App placement in cloud foundry

    I have loads of room! I guess I can run one app. Don’t talk to me. No space here. Computers, give me your bids! Auctioneer Source: Gupta - App Placement In Cloud Foundry Diego
  39. 64.

    VICKREY–CLARKE–GROVES Profit = Payment - Cost Paid by the auctioneer

    to each machine after a round of bidding The more work the computer has to do, the greater the cost Source: Grosu - Load Balancing In Distributed Systems: A Game Theoretic Approach
  40. 65.

    –Nassim Nicholas Taleb “Antifragility is beyond resilience or robustness. The

    resilient resists shocks and stays the same; the antifragile gets better.”
  41. 66.

    1. Instructions 2. GAME ONE : Bargaining 3. GAME TWO

    : Auction 4. ADAPTING the Rules 5. Game over
  42. 67.

    RESULTS When we know the capabilities of the machines in

    a distributed system, we can use the Nash Bargaining Solution to determine how we should allocate resources.
  43. 68.

    RESULTS When we don’t know the capabilities of the machines

    in a distributed system, we can use second- price auctions to reveal what the capabilities are.
  44. 69.

    LEVELLING UP Game Theory can help you break down complex

    problems. Start basic and build in more realistic assumptions.
  45. 70.
  46. 72.

    SOURCES LOAD BALANCING IN DISTRIBUTED SYSTEMS: A GAME THEORETIC APPROACH

    Daniel Grosu http://www.cs.utsa.edu/uploads/theses/DGrosu.pdf APP PLACEMENT IN CLOUD FOUNDRY DIEGO: A CLASSICAL OPTIMIZATION PROBLEM Amit Gupta http://blog.pivotal.io/cloud-foundry-pivotal/products/app-placement-in-cloud-foundry-diego-a-classical-optimization-problem NETWORKS, CROWDS, AND MARKETS: REASONING ABOUT A HIGHLY CONNECTED WORLD David Easly & Jon Kleinberg http://www.cs.cornell.edu/home/kleinber/networks-book/ AUCTIONS AND BIDDING: A GUIDE FOR COMPUTER SCIENTISTS Simon Parsons, Juan A. Rodriguez-Aguilar, and Mark Klein https://cgi.csc.liv.ac.uk/~sp/publications/journals/acs.pdf