SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
GAMES  FOR  THE  MASSES
 SCALING  RAILS  TO  THE  EXTREME
          EuRuKo  2011  in  Berlin
Who  is  that  guy?

 Jesper  Richter-­‐Reichhelm
 @jrirei
 Berlin,  Germany
 Head  of  Engineering  @  wooga
Wooga  develops  social  games
Wooga  has  dedicated  game  teams



        PHP       Ruby             Ruby
        SQL     SQL  +  Redis     Redis
       Cloud      Cloud         Bare  Metal
Wooga  has  dedicated  game  teams



        PHP       Ruby             Ruby
        SQL     SQL  +  Redis     Redis
       Cloud      Cloud         Bare  Metal
Both  games  are  similar  in  their  setup
      Flash  client              Ruby  backend
Both  games  have  similar  problems

 High  traffic
 • 200+  million  h=p  requests  /  day
 High  DB  throughput
 • 100.000  DB  operaDons  /  second
 Hardest  problems  to  solve
 • DB  migraDons,  DB  failover,  DB  performance,  ...
What’s  best?

 Big  cloud  vs.  bare  metal

 Hybrid  (SQL  +  Redis)  vs.  Redis  only

 In-­‐memory  vs.  DB  hierarchy

 Conclusion:  So  what’s  best?
Big  cloud  vs.  bare  metal


 Big  cloud:  Amazon  EC2
 • new  server  in  5  minutes
 • automated  deployment
 • load  based  setup
Big  cloud  vs.  bare  metal


 Big  cloud:  Amazon  EC2        Bare  metal:  Hetzner
 • new  server  in  5  minutes   • new  server  in  2-­‐14  days
 • automated  deployment         • automated  deployment
 • load  based  setup
What  kind  of  app  server  are  available?


 XL  CPU  instance
 • 8  virtual  cores
 • 8  GB  RAM
Bare  metal  servers  are  more  powerful


 XL  CPU  instance       EQ10  server
 • 8  virtual  cores     • 12  “processing  threads”
 • 8  GB  RAM            • 24  GB  RAM
Bare  metal  servers  are  more  powerful


 XL  CPU  instance          EQ10  server
 • 8  virtual  cores        • 12  “processing  threads”
 • 8  GB  RAM               • 24  GB  RAM


 =>  390,-­‐  €  /  month   =>  200,-­‐  €  /  month
And  how  is  the  network?


 min  ping:  0.2  -­‐  0.3  ms   min  ping:  0.2  ms
Want  a  fast  network?  Get  your  own!


 min  ping:  0.2  -­‐  0.3  ms   min  ping:  0.2  ms
 max  ping:  7.8  -­‐  59  ms    max  ping:  0.3  ms
 avg  ping:  0.8  -­‐  4.4  ms   avg  ping:  0.2  ms
Want  a  fast  network?  Get  your  own!


 min  ping:  0.2  -­‐  0.3  ms    min  ping:  0.2  ms
 max  ping:  7.8  -­‐  59  ms     max  ping:  0.3  ms
 avg  ping:  0.8  -­‐  4.4  ms    avg  ping:  0.2  ms


 22  DB  calls  per  hfp  calls   saved  13  -­‐  92  ms  latency
What’s  befer?  Depends  on  your  needs!


 Big  cloud  is  great  if  you
 • don’t  know  your  load
 • scale  up  /  down  quickly
What’s  befer?  Depends  on  your  needs!


 Big  cloud  is  great  if  you   Bare  metal  is  great  if  you
 • don’t  know  your  load        • want  to  save  money
 • scale  up  /  down  quickly    • need  stable  performance
What’s  befer?  Depends  on  your  needs!


 Big  cloud  is  great  if  you   Bare  metal  is  great  if  you
 • don’t  know  your  load        • want  to  save  money
 • scale  up  /  down  quickly    • need  stable  performance


 Say:  “Don’t  worry”             Say:  “Think  ahead”
What’s  best?

 Big  cloud  vs.  bare  metal

 Hybrid  (SQL  +  Redis)  vs.  Redis  only

 In-­‐memory  vs.  DB  hierarchy

 Conclusion:  So  what’s  best?
Hybrid  (SQL  +  Redis)  vs.  Redis


 Hybrid  (SQL  +  Redis)               Redis  only
 • started  with  MySQL
 • hit  a  wall  due  to  IO  limits
 • introduced  Redis  later
If  MySQL  is  a  truck,  ...

 Fast  enough  for  reads
 Can  store  on  disk
 Robust  replicakon




      h=p://www.flickr.com/photos/erix/245657047/
If  MySQL  is  a  truck,  Redis  is  a  Ferrari

 Fast  enough  for  reads                          Super  fast  reads/writes
 Can  store  on  disk                              Out  of  memory  =>  dead
 Robust  replicakon                                Fragile  replicakon




      h=p://www.flickr.com/photos/erix/245657047/
Hybrid  (SQL  +  Redis)  vs.  Redis


 Hybrid  (SQL  +  Redis)               Redis  only
 • started  with  MySQL
 • hit  a  wall  due  to  IO  limits
 • introduced  Redis  later
Hybrid  (SQL  +  Redis)  vs.  Redis


 Hybrid  (SQL  +  Redis)               Redis  only
 • started  with  MySQL
 • hit  a  wall  due  to  IO  limits
 • introduced  Redis  later


 MySQL  has  its  hard  limits         Works  fine  if  done  right
How  many  tables  to  store  a  user  in?


 22  MySQL  tables
 7  Redis  hashes
How  many  tables  to  store  a  user  in?


 22  MySQL  tables         1  Redis  Hash
 7  Redis  hashes
How  many  tables  to  store  a  user  in?


 22  MySQL  tables             1  Redis  Hash
 7  Redis  hashes


 Easy  to  implement           Less  top  level  keys
 Faster  for  small  changes   Export  and  import  is  easy
What’s  best?

 Big  cloud  vs.  bare  metal

 Hybrid  (SQL  +  Redis)  vs.  Redis  only

 In-­‐memory  vs.  DB  hierarchy

 Conclusion:  So  what’s  best?
Redis  storage  type


 Redis  works  in-­‐memory
 Dumps  slow  down  master
 • Dumping  on  slaves  only
Redis  storage  type


 Redis  works  in-­‐memory     Redis  used  vm
 Dumps  slow  down  master     Dumps  to  disk  impossible
 • Dumping  on  slaves  only   • Own  system  to  store  
                                 JSON  files  to  disk
Redis  storage  type


 Redis  works  in-­‐memory     Redis  used  vm
 Dumps  slow  down  master     Dumps  to  disk  impossible
 • Dumping  on  slaves  only   • Own  system  to  store  
                                 JSON  files  to  disk
                               Redis  became  a  cache  only
Redis  storage  type


 Redis  works  in-­‐memory     Redis  now  uses  diskstore
 Dumps  slow  down  master
 • Dumping  on  slaves  only
Redis  storage  type


 Redis  works  in-­‐memory     Redis  now  uses  diskstore
 Dumps  slow  down  master     • Experimental  branch
 • Dumping  on  slaves  only   • Stores  async.  to  disk  
Redis  storage  type


 Redis  works  in-­‐memory     Redis  now  uses  diskstore
 Dumps  slow  down  master     • Experimental  branch
 • Dumping  on  slaves  only   • Stores  async.  to  disk  


                               Redis  became  a  DB  again
There  are  many  inackve  users


    
 hourly     0,3M                              hourly 0,1M

   daily        1,3M                            daily        0,4M

monthly                 8,0M                 monthly                     3,0M

lifetime                             20,8M   lifetime                            6,0M

           0M          8M      16M   24M                0M          2M     4M   6M
Not  all  users  play  at  the  same  day


 In-­‐memory                DB  hierarchy
                            • Redis  in-­‐memory
                            • Redis  diskstore  on  disk


 100%  of  users  in  RAM   3%  of  users  in  RAM
What’s  best?

 Big  cloud  vs.  bare  metal

 Hybrid  (SQL  +  Redis)  vs.  Redis  only

 In-­‐memory  vs.  DB  hierarchy

 Conclusion:  So  what’s  best?
So,  what  didn’t  work?


 Big  cloud                Bare  metal
 Hybrid  (SQL  +  Redis)   Redis  only
 In-­‐memory  “only”       DB  hierarchy
So,  what  didn’t  work?


 Big  cloud                Bare  metal
 Hybrid  (SQL  +  Redis)   Redis  only
 In-­‐memory  “only”       DB  hierarchy
Let’s  dig  a  bit  deeper


 1,300,000  daily  users     400,000  daily  users  
 5000  hfp  calls/s  peak    2500  hfp  calls/s  peak
 100  ms  response  kme      10  ms  response  kme


 35-­‐70  servers            11  servers
Hoskng  costs  /  DAU  compared


                    HosDng




     5x  higher
There  are  2  main  reasons  for  higher  cost


                         Databases   Other



    Other:  3x  higher


    DB:  20x  higher
There  are  2  main  reasons  for  higher  cost


                             Databases         Other



    Other:  3x  higher

                                         No  DB  hierarchy!
    DB:  20x  higher
    (both  RAM  and  cost)
So,  what  didn’t  work?


 Big  cloud                Bare  metal
 Hybrid  (SQL  +  Redis)   Redis  only
 In-­‐memory  “only”       DB  hierarchy
So,  what  didn’t  work?


                    ds  ...
 Big  cloud dep  en           Bare  metal
 Hybrid  (SQL  +  Redis)      Redis  only
 In-­‐memory  “only”          DB  hierarchy
So,  what  didn’t  work?


                    ds  ...
 Big  cloud dep  en                     Bare  metal
 Hybrid  (SQL  +  Redis)                Redis  only
                              nev er
 In-­‐memory  “only”              in!   DB  hierarchy
                              a ga
So,  what  didn’t  work?


                    ds  ...
 Big  cloud dep  en                        Bare  metal
 Hybrid  (SQL  +  Redis)             er,   Redis  only
                            er,    ev
 In-­‐memory  “only”  n  ev           n!   DB  hierarchy
                                 ag ai
                         ev er
Next  game  will  do  things  befer


 Start  in  cloud  and  then  go  metal?
 Redis  only
 DB  hierarchy
BTW,  wooga  is  hiring!



                         Q  &  A
   Jesper  Richter-­‐Reichhelm
             @jrirei
     slideshare.net/wooga        wooga.com/jobs
BTW,  wooga  is  hiring!



                    Thank  you
   Jesper  Richter-­‐Reichhelm
             @jrirei
     slideshare.net/wooga        wooga.com/jobs

Weitere ähnliche Inhalte

Was ist angesagt?

MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
Sean Laurent
 
Fosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performanceFosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performance
Erup Enolc
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
jimbojsb
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
Avi Kedar
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
elliando dias
 
Newsql 2015-150213024325-conversion-gate01
Newsql 2015-150213024325-conversion-gate01Newsql 2015-150213024325-conversion-gate01
Newsql 2015-150213024325-conversion-gate01
Jagadeesha DG
 
Coldfusion comparison
Coldfusion comparisonColdfusion comparison
Coldfusion comparison
isotools_2012
 

Was ist angesagt? (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
 
Fosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performanceFosdem 2009 – improving drupal's page loading performance
Fosdem 2009 – improving drupal's page loading performance
 
MongoDB as a fast and queryable cache
MongoDB as a fast and queryable cacheMongoDB as a fast and queryable cache
MongoDB as a fast and queryable cache
 
Dibi Conference 2012
Dibi Conference 2012Dibi Conference 2012
Dibi Conference 2012
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
 
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 201910 Ways to Scale Your Website Silicon Valley Code Camp 2019
10 Ways to Scale Your Website Silicon Valley Code Camp 2019
 
10 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 201910 Ways to Scale with Redis - LA Redis Meetup 2019
10 Ways to Scale with Redis - LA Redis Meetup 2019
 
Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!Add Redis to Postgres to Make Your Microservices Go Boom!
Add Redis to Postgres to Make Your Microservices Go Boom!
 
Leveraging MongoDB: An Introductory Case Study
Leveraging MongoDB: An Introductory Case StudyLeveraging MongoDB: An Introductory Case Study
Leveraging MongoDB: An Introductory Case Study
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
A web app in pure Clojure
A web app in pure ClojureA web app in pure Clojure
A web app in pure Clojure
 
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen AnhOGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
My first powershell script
My first powershell scriptMy first powershell script
My first powershell script
 
Newsql 2015-150213024325-conversion-gate01
Newsql 2015-150213024325-conversion-gate01Newsql 2015-150213024325-conversion-gate01
Newsql 2015-150213024325-conversion-gate01
 
Coldfusion comparison
Coldfusion comparisonColdfusion comparison
Coldfusion comparison
 

Andere mochten auch

Getting the Most our of your Tools_FrontEnd DevConf2013_Minsk
Getting the Most our of your Tools_FrontEnd DevConf2013_MinskGetting the Most our of your Tools_FrontEnd DevConf2013_Minsk
Getting the Most our of your Tools_FrontEnd DevConf2013_Minsk
Wooga
 
JRubyConf2013_Tim Lossen_All your core
JRubyConf2013_Tim Lossen_All your coreJRubyConf2013_Tim Lossen_All your core
JRubyConf2013_Tim Lossen_All your core
Wooga
 
2013 04-29-evolution of backend
2013 04-29-evolution of backend2013 04-29-evolution of backend
2013 04-29-evolution of backend
Wooga
 
Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013
Wooga
 

Andere mochten auch (20)

Ruby Proxies for Scale, Performance, and Monitoring
Ruby Proxies for Scale, Performance, and MonitoringRuby Proxies for Scale, Performance, and Monitoring
Ruby Proxies for Scale, Performance, and Monitoring
 
Stateful Application Server_JRubyConf13_Lukas Rieder
Stateful Application Server_JRubyConf13_Lukas RiederStateful Application Server_JRubyConf13_Lukas Rieder
Stateful Application Server_JRubyConf13_Lukas Rieder
 
Getting the Most our of your Tools_FrontEnd DevConf2013_Minsk
Getting the Most our of your Tools_FrontEnd DevConf2013_MinskGetting the Most our of your Tools_FrontEnd DevConf2013_Minsk
Getting the Most our of your Tools_FrontEnd DevConf2013_Minsk
 
Designing for Scale
Designing for ScaleDesigning for Scale
Designing for Scale
 
JRubyConf2013_Tim Lossen_All your core
JRubyConf2013_Tim Lossen_All your coreJRubyConf2013_Tim Lossen_All your core
JRubyConf2013_Tim Lossen_All your core
 
Architecture Evolution at Wooga (AWS Cloud Computing for Developers,)
Architecture Evolution at Wooga (AWS Cloud Computing for Developers,)Architecture Evolution at Wooga (AWS Cloud Computing for Developers,)
Architecture Evolution at Wooga (AWS Cloud Computing for Developers,)
 
NoSQL Games_NoSQL Roadshow Berlin
NoSQL Games_NoSQL Roadshow BerlinNoSQL Games_NoSQL Roadshow Berlin
NoSQL Games_NoSQL Roadshow Berlin
 
Erlang as a Cloud Citizen
Erlang as a Cloud CitizenErlang as a Cloud Citizen
Erlang as a Cloud Citizen
 
Metrics. Driven. Design. (Developer Conference Hamburg 2012)
Metrics. Driven. Design. (Developer Conference Hamburg 2012)Metrics. Driven. Design. (Developer Conference Hamburg 2012)
Metrics. Driven. Design. (Developer Conference Hamburg 2012)
 
How to scale a company - game teams at Wooga
How to scale a company - game teams at WoogaHow to scale a company - game teams at Wooga
How to scale a company - game teams at Wooga
 
Event Stream Processing with Kafka (Berlin Buzzwords 2012)
Event Stream Processing with Kafka (Berlin Buzzwords 2012)Event Stream Processing with Kafka (Berlin Buzzwords 2012)
Event Stream Processing with Kafka (Berlin Buzzwords 2012)
 
2013 04-29-evolution of backend
2013 04-29-evolution of backend2013 04-29-evolution of backend
2013 04-29-evolution of backend
 
You are not alone - Scaling multiplayer games
You are not alone - Scaling multiplayer gamesYou are not alone - Scaling multiplayer games
You are not alone - Scaling multiplayer games
 
Stateful_Application_Server_RuPy 2012_Brno
Stateful_Application_Server_RuPy 2012_BrnoStateful_Application_Server_RuPy 2012_Brno
Stateful_Application_Server_RuPy 2012_Brno
 
More than syntax
More than syntaxMore than syntax
More than syntax
 
Continuous Integration for iOS (iOS User Group Berlin)
Continuous Integration for iOS (iOS User Group Berlin)Continuous Integration for iOS (iOS User Group Berlin)
Continuous Integration for iOS (iOS User Group Berlin)
 
Painful success - lessons learned while scaling up
Painful success - lessons learned while scaling upPainful success - lessons learned while scaling up
Painful success - lessons learned while scaling up
 
NoSQL Games
NoSQL GamesNoSQL Games
NoSQL Games
 
Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013Wooga: Internationality meets Agility @Zutaten 2013
Wooga: Internationality meets Agility @Zutaten 2013
 
Monitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachineMonitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachine
 

Ähnlich wie Games for the Masses: Scaling Rails to the Extreme

Hybrid my sql_hadoop_datawarehouse
Hybrid my sql_hadoop_datawarehouseHybrid my sql_hadoop_datawarehouse
Hybrid my sql_hadoop_datawarehouse
Laine Campbell
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
Tim Lossen
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
Ricard Clau
 
New York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome SessionNew York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome Session
Aleksandr Yampolskiy
 
Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDBIntro to NoSQL and MongoDB
Intro to NoSQL and MongoDB
DATAVERSITY
 

Ähnlich wie Games for the Masses: Scaling Rails to the Extreme (20)

Storage Engine Wars at Parse
Storage Engine Wars at ParseStorage Engine Wars at Parse
Storage Engine Wars at Parse
 
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB DayChoosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
Choosing the Right Database Service (김상필, 유타카 호시노) - AWS DB Day
 
RedisConf18 - Redis on Flash
RedisConf18 - Redis on FlashRedisConf18 - Redis on Flash
RedisConf18 - Redis on Flash
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
 
Hybrid my sql_hadoop_datawarehouse
Hybrid my sql_hadoop_datawarehouseHybrid my sql_hadoop_datawarehouse
Hybrid my sql_hadoop_datawarehouse
 
How and when to use NoSQL
How and when to use NoSQLHow and when to use NoSQL
How and when to use NoSQL
 
Beware of your Hype Value Stores
Beware of your Hype Value StoresBeware of your Hype Value Stores
Beware of your Hype Value Stores
 
Running MongoDB in the Cloud
Running MongoDB in the CloudRunning MongoDB in the Cloud
Running MongoDB in the Cloud
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
 
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
Production NoSQL in an Hour: Introduction to Amazon DynamoDB (DAT101) | AWS r...
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
How & When to Use NoSQL at Websummit Dublin
How & When to Use NoSQL at Websummit DublinHow & When to Use NoSQL at Websummit Dublin
How & When to Use NoSQL at Websummit Dublin
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
 
Linux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQLLinux and H/W optimizations for MySQL
Linux and H/W optimizations for MySQL
 
NoSQL in the context of Social Web
NoSQL in the context of Social WebNoSQL in the context of Social Web
NoSQL in the context of Social Web
 
New York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome SessionNew York REDIS Meetup Welcome Session
New York REDIS Meetup Welcome Session
 
Getting Started with Big Data and HPC in the Cloud - August 2015
Getting Started with Big Data and HPC in the Cloud - August 2015Getting Started with Big Data and HPC in the Cloud - August 2015
Getting Started with Big Data and HPC in the Cloud - August 2015
 
NOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the CloudNOSQL, CouchDB, and the Cloud
NOSQL, CouchDB, and the Cloud
 
Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDBIntro to NoSQL and MongoDB
Intro to NoSQL and MongoDB
 

Mehr von Wooga

Riak & Wooga_Geeek2Geeek Meetup2014 Berlin
Riak & Wooga_Geeek2Geeek Meetup2014 BerlinRiak & Wooga_Geeek2Geeek Meetup2014 Berlin
Riak & Wooga_Geeek2Geeek Meetup2014 Berlin
Wooga
 
Staying in the Game: Game localization practices for the mobile market
Staying in the Game: Game localization practices for the mobile marketStaying in the Game: Game localization practices for the mobile market
Staying in the Game: Game localization practices for the mobile market
Wooga
 
Startup Weekend_Makers and Games_Philipp Stelzer
Startup Weekend_Makers and Games_Philipp StelzerStartup Weekend_Makers and Games_Philipp Stelzer
Startup Weekend_Makers and Games_Philipp Stelzer
Wooga
 
CodeFest 2014_Mobile Game Development
CodeFest 2014_Mobile Game DevelopmentCodeFest 2014_Mobile Game Development
CodeFest 2014_Mobile Game Development
Wooga
 
How to hire the best people for your startup-Gitta Blat-Head of People
How to hire the best people for your startup-Gitta Blat-Head of PeopleHow to hire the best people for your startup-Gitta Blat-Head of People
How to hire the best people for your startup-Gitta Blat-Head of People
Wooga
 
Pocket Gamer Connects 2014_The Experience of Entering the Korean Market
Pocket Gamer Connects 2014_The Experience of Entering the Korean MarketPocket Gamer Connects 2014_The Experience of Entering the Korean Market
Pocket Gamer Connects 2014_The Experience of Entering the Korean Market
Wooga
 

Mehr von Wooga (20)

Story of Warlords: Bringing a turn-based strategy game to mobile
Story of Warlords: Bringing a turn-based strategy game to mobile Story of Warlords: Bringing a turn-based strategy game to mobile
Story of Warlords: Bringing a turn-based strategy game to mobile
 
Instagram Celebrities: are they the new cats? - Targetsummit Berlin 2015
Instagram Celebrities: are they the new cats? - Targetsummit Berlin 2015Instagram Celebrities: are they the new cats? - Targetsummit Berlin 2015
Instagram Celebrities: are they the new cats? - Targetsummit Berlin 2015
 
In it for the long haul - How Wooga boosts long-term retention
In it for the long haul - How Wooga boosts long-term retentionIn it for the long haul - How Wooga boosts long-term retention
In it for the long haul - How Wooga boosts long-term retention
 
Leveling up in localization! - Susan Alma & Dario Quondamstefano
Leveling up in localization! - Susan Alma & Dario QuondamstefanoLeveling up in localization! - Susan Alma & Dario Quondamstefano
Leveling up in localization! - Susan Alma & Dario Quondamstefano
 
Evoloution of Ideas
Evoloution of IdeasEvoloution of Ideas
Evoloution of Ideas
 
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
 
Saying No to the CEO: A Deep Look at Independent Teams - Adam Telfer
Saying No to the CEO: A Deep Look at Independent Teams - Adam TelferSaying No to the CEO: A Deep Look at Independent Teams - Adam Telfer
Saying No to the CEO: A Deep Look at Independent Teams - Adam Telfer
 
Innovation dank DevOps (DevOpsCon Berlin 2015)
Innovation dank DevOps (DevOpsCon Berlin 2015)Innovation dank DevOps (DevOpsCon Berlin 2015)
Innovation dank DevOps (DevOpsCon Berlin 2015)
 
Big Fish, small pond - strategies for surviving in a maturing market - Ed Biden
Big Fish, small pond - strategies for surviving in a maturing market - Ed BidenBig Fish, small pond - strategies for surviving in a maturing market - Ed Biden
Big Fish, small pond - strategies for surviving in a maturing market - Ed Biden
 
Review mining aps2014 berlin
Review mining aps2014 berlinReview mining aps2014 berlin
Review mining aps2014 berlin
 
Riak & Wooga_Geeek2Geeek Meetup2014 Berlin
Riak & Wooga_Geeek2Geeek Meetup2014 BerlinRiak & Wooga_Geeek2Geeek Meetup2014 Berlin
Riak & Wooga_Geeek2Geeek Meetup2014 Berlin
 
Staying in the Game: Game localization practices for the mobile market
Staying in the Game: Game localization practices for the mobile marketStaying in the Game: Game localization practices for the mobile market
Staying in the Game: Game localization practices for the mobile market
 
Startup Weekend_Makers and Games_Philipp Stelzer
Startup Weekend_Makers and Games_Philipp StelzerStartup Weekend_Makers and Games_Philipp Stelzer
Startup Weekend_Makers and Games_Philipp Stelzer
 
DevOps goes Mobile (daho.am)
DevOps goes Mobile (daho.am)DevOps goes Mobile (daho.am)
DevOps goes Mobile (daho.am)
 
DevOps goes Mobile - Jax 2014 - Jesper Richter-Reichhelm
DevOps goes Mobile - Jax 2014 - Jesper Richter-ReichhelmDevOps goes Mobile - Jax 2014 - Jesper Richter-Reichhelm
DevOps goes Mobile - Jax 2014 - Jesper Richter-Reichhelm
 
CodeFest 2014_Mobile Game Development
CodeFest 2014_Mobile Game DevelopmentCodeFest 2014_Mobile Game Development
CodeFest 2014_Mobile Game Development
 
Jelly Splash: Puzzling your way to the top of the App Stores - GDC 2014
Jelly Splash: Puzzling your way to the top of the App Stores - GDC 2014Jelly Splash: Puzzling your way to the top of the App Stores - GDC 2014
Jelly Splash: Puzzling your way to the top of the App Stores - GDC 2014
 
How to hire the best people for your startup-Gitta Blat-Head of People
How to hire the best people for your startup-Gitta Blat-Head of PeopleHow to hire the best people for your startup-Gitta Blat-Head of People
How to hire the best people for your startup-Gitta Blat-Head of People
 
Two Ann(e)s and one Julia_Wooga Lady Power from Berlin_SGA2014
Two Ann(e)s and one Julia_Wooga Lady Power from Berlin_SGA2014Two Ann(e)s and one Julia_Wooga Lady Power from Berlin_SGA2014
Two Ann(e)s and one Julia_Wooga Lady Power from Berlin_SGA2014
 
Pocket Gamer Connects 2014_The Experience of Entering the Korean Market
Pocket Gamer Connects 2014_The Experience of Entering the Korean MarketPocket Gamer Connects 2014_The Experience of Entering the Korean Market
Pocket Gamer Connects 2014_The Experience of Entering the Korean Market
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Games for the Masses: Scaling Rails to the Extreme

  • 1. GAMES  FOR  THE  MASSES SCALING  RAILS  TO  THE  EXTREME EuRuKo  2011  in  Berlin
  • 2. Who  is  that  guy? Jesper  Richter-­‐Reichhelm @jrirei Berlin,  Germany Head  of  Engineering  @  wooga
  • 4. Wooga  has  dedicated  game  teams PHP Ruby Ruby SQL SQL  +  Redis Redis Cloud Cloud Bare  Metal
  • 5. Wooga  has  dedicated  game  teams PHP Ruby Ruby SQL SQL  +  Redis Redis Cloud Cloud Bare  Metal
  • 6. Both  games  are  similar  in  their  setup Flash  client Ruby  backend
  • 7. Both  games  have  similar  problems High  traffic • 200+  million  h=p  requests  /  day High  DB  throughput • 100.000  DB  operaDons  /  second Hardest  problems  to  solve • DB  migraDons,  DB  failover,  DB  performance,  ...
  • 8. What’s  best? Big  cloud  vs.  bare  metal Hybrid  (SQL  +  Redis)  vs.  Redis  only In-­‐memory  vs.  DB  hierarchy Conclusion:  So  what’s  best?
  • 9. Big  cloud  vs.  bare  metal Big  cloud:  Amazon  EC2 • new  server  in  5  minutes • automated  deployment • load  based  setup
  • 10. Big  cloud  vs.  bare  metal Big  cloud:  Amazon  EC2 Bare  metal:  Hetzner • new  server  in  5  minutes • new  server  in  2-­‐14  days • automated  deployment • automated  deployment • load  based  setup
  • 11. What  kind  of  app  server  are  available? XL  CPU  instance • 8  virtual  cores • 8  GB  RAM
  • 12. Bare  metal  servers  are  more  powerful XL  CPU  instance EQ10  server • 8  virtual  cores • 12  “processing  threads” • 8  GB  RAM • 24  GB  RAM
  • 13. Bare  metal  servers  are  more  powerful XL  CPU  instance EQ10  server • 8  virtual  cores • 12  “processing  threads” • 8  GB  RAM • 24  GB  RAM =>  390,-­‐  €  /  month =>  200,-­‐  €  /  month
  • 14. And  how  is  the  network? min  ping:  0.2  -­‐  0.3  ms min  ping:  0.2  ms
  • 15. Want  a  fast  network?  Get  your  own! min  ping:  0.2  -­‐  0.3  ms min  ping:  0.2  ms max  ping:  7.8  -­‐  59  ms max  ping:  0.3  ms avg  ping:  0.8  -­‐  4.4  ms avg  ping:  0.2  ms
  • 16. Want  a  fast  network?  Get  your  own! min  ping:  0.2  -­‐  0.3  ms min  ping:  0.2  ms max  ping:  7.8  -­‐  59  ms max  ping:  0.3  ms avg  ping:  0.8  -­‐  4.4  ms avg  ping:  0.2  ms 22  DB  calls  per  hfp  calls saved  13  -­‐  92  ms  latency
  • 17. What’s  befer?  Depends  on  your  needs! Big  cloud  is  great  if  you • don’t  know  your  load • scale  up  /  down  quickly
  • 18. What’s  befer?  Depends  on  your  needs! Big  cloud  is  great  if  you Bare  metal  is  great  if  you • don’t  know  your  load • want  to  save  money • scale  up  /  down  quickly • need  stable  performance
  • 19. What’s  befer?  Depends  on  your  needs! Big  cloud  is  great  if  you Bare  metal  is  great  if  you • don’t  know  your  load • want  to  save  money • scale  up  /  down  quickly • need  stable  performance Say:  “Don’t  worry” Say:  “Think  ahead”
  • 20. What’s  best? Big  cloud  vs.  bare  metal Hybrid  (SQL  +  Redis)  vs.  Redis  only In-­‐memory  vs.  DB  hierarchy Conclusion:  So  what’s  best?
  • 21. Hybrid  (SQL  +  Redis)  vs.  Redis Hybrid  (SQL  +  Redis) Redis  only • started  with  MySQL • hit  a  wall  due  to  IO  limits • introduced  Redis  later
  • 22. If  MySQL  is  a  truck,  ... Fast  enough  for  reads Can  store  on  disk Robust  replicakon h=p://www.flickr.com/photos/erix/245657047/
  • 23. If  MySQL  is  a  truck,  Redis  is  a  Ferrari Fast  enough  for  reads Super  fast  reads/writes Can  store  on  disk Out  of  memory  =>  dead Robust  replicakon Fragile  replicakon h=p://www.flickr.com/photos/erix/245657047/
  • 24. Hybrid  (SQL  +  Redis)  vs.  Redis Hybrid  (SQL  +  Redis) Redis  only • started  with  MySQL • hit  a  wall  due  to  IO  limits • introduced  Redis  later
  • 25. Hybrid  (SQL  +  Redis)  vs.  Redis Hybrid  (SQL  +  Redis) Redis  only • started  with  MySQL • hit  a  wall  due  to  IO  limits • introduced  Redis  later MySQL  has  its  hard  limits Works  fine  if  done  right
  • 26. How  many  tables  to  store  a  user  in? 22  MySQL  tables 7  Redis  hashes
  • 27. How  many  tables  to  store  a  user  in? 22  MySQL  tables 1  Redis  Hash 7  Redis  hashes
  • 28. How  many  tables  to  store  a  user  in? 22  MySQL  tables 1  Redis  Hash 7  Redis  hashes Easy  to  implement Less  top  level  keys Faster  for  small  changes Export  and  import  is  easy
  • 29. What’s  best? Big  cloud  vs.  bare  metal Hybrid  (SQL  +  Redis)  vs.  Redis  only In-­‐memory  vs.  DB  hierarchy Conclusion:  So  what’s  best?
  • 30. Redis  storage  type Redis  works  in-­‐memory Dumps  slow  down  master • Dumping  on  slaves  only
  • 31. Redis  storage  type Redis  works  in-­‐memory Redis  used  vm Dumps  slow  down  master Dumps  to  disk  impossible • Dumping  on  slaves  only • Own  system  to  store   JSON  files  to  disk
  • 32. Redis  storage  type Redis  works  in-­‐memory Redis  used  vm Dumps  slow  down  master Dumps  to  disk  impossible • Dumping  on  slaves  only • Own  system  to  store   JSON  files  to  disk Redis  became  a  cache  only
  • 33. Redis  storage  type Redis  works  in-­‐memory Redis  now  uses  diskstore Dumps  slow  down  master • Dumping  on  slaves  only
  • 34. Redis  storage  type Redis  works  in-­‐memory Redis  now  uses  diskstore Dumps  slow  down  master • Experimental  branch • Dumping  on  slaves  only • Stores  async.  to  disk  
  • 35. Redis  storage  type Redis  works  in-­‐memory Redis  now  uses  diskstore Dumps  slow  down  master • Experimental  branch • Dumping  on  slaves  only • Stores  async.  to  disk   Redis  became  a  DB  again
  • 36. There  are  many  inackve  users   hourly 0,3M hourly 0,1M daily 1,3M daily 0,4M monthly 8,0M monthly 3,0M lifetime 20,8M lifetime 6,0M 0M 8M 16M 24M 0M 2M 4M 6M
  • 37. Not  all  users  play  at  the  same  day In-­‐memory DB  hierarchy • Redis  in-­‐memory • Redis  diskstore  on  disk 100%  of  users  in  RAM 3%  of  users  in  RAM
  • 38. What’s  best? Big  cloud  vs.  bare  metal Hybrid  (SQL  +  Redis)  vs.  Redis  only In-­‐memory  vs.  DB  hierarchy Conclusion:  So  what’s  best?
  • 39. So,  what  didn’t  work? Big  cloud Bare  metal Hybrid  (SQL  +  Redis) Redis  only In-­‐memory  “only” DB  hierarchy
  • 40. So,  what  didn’t  work? Big  cloud Bare  metal Hybrid  (SQL  +  Redis) Redis  only In-­‐memory  “only” DB  hierarchy
  • 41. Let’s  dig  a  bit  deeper 1,300,000  daily  users 400,000  daily  users   5000  hfp  calls/s  peak 2500  hfp  calls/s  peak 100  ms  response  kme 10  ms  response  kme 35-­‐70  servers 11  servers
  • 42. Hoskng  costs  /  DAU  compared HosDng 5x  higher
  • 43. There  are  2  main  reasons  for  higher  cost Databases Other Other:  3x  higher DB:  20x  higher
  • 44. There  are  2  main  reasons  for  higher  cost Databases Other Other:  3x  higher No  DB  hierarchy! DB:  20x  higher (both  RAM  and  cost)
  • 45. So,  what  didn’t  work? Big  cloud Bare  metal Hybrid  (SQL  +  Redis) Redis  only In-­‐memory  “only” DB  hierarchy
  • 46. So,  what  didn’t  work? ds  ... Big  cloud dep en Bare  metal Hybrid  (SQL  +  Redis) Redis  only In-­‐memory  “only” DB  hierarchy
  • 47. So,  what  didn’t  work? ds  ... Big  cloud dep en Bare  metal Hybrid  (SQL  +  Redis) Redis  only nev er In-­‐memory  “only” in! DB  hierarchy a ga
  • 48. So,  what  didn’t  work? ds  ... Big  cloud dep en Bare  metal Hybrid  (SQL  +  Redis) er, Redis  only er,  ev In-­‐memory  “only” n ev n! DB  hierarchy  ag ai ev er
  • 49. Next  game  will  do  things  befer Start  in  cloud  and  then  go  metal? Redis  only DB  hierarchy
  • 50. BTW,  wooga  is  hiring! Q  &  A Jesper  Richter-­‐Reichhelm @jrirei slideshare.net/wooga wooga.com/jobs
  • 51. BTW,  wooga  is  hiring! Thank  you Jesper  Richter-­‐Reichhelm @jrirei slideshare.net/wooga wooga.com/jobs