0
Kazuhiro Ogura
@goura
小椋 一宏
Building a Minecraft
Server for Families
(Using AutoScalingGroup)
Kazuhiro Ogura
HDE, Inc.
Of course you know
about Minecraft
http://www.gamespot.com/articles/minecraft-passes-100-million-registered-users-14-3-million-sales-on-pc/1100-6417972/
http://www.wired.co.uk/news/archive/2014-03/13/minecraft-cloudmaker
I’m playing this game
for about a year
…with my 7-years old son
Minecraft is not an MMO
But It’s an MO
(Massive Multiplayer Online Game)
P2P Play
PC
(Host)
PC
(Guest)
PC
(Guest)
PC
(Guest)
Not for a kid/dad who
doesn’t live in the same
timeframe
Dedicated Server
Server
(Host)
PC
(Guest)
PC
(Guest)
PC
(Guest)
minecraft_server.jar
• Free
• Distributed as a jar file (Need JRE to run)
• Official version from Mojang, 

open source clon...
So I started like this
Server
(Host)
My PC
(Guest)
Kid’s PC
(Guest)
Sakura VPS
RAM: 512MB
Daytime
Server
(Host)
My PC
(Guest)
Kid’s PC
(Guest)
Sakura VPS
RAM: 512MB
Nighttime
Server
(Host)
My PC
(Guest)
Kid’s PC
(Guest)
Sakura VPS
RAM: 512MB
Weekends
This worked

for a while
Kid builds in daytime,
dad mines at night
Kid builds in daytime,
dad mines at night
On weekends we explore
scary places together
Image taken from:
http://www.fromstrangeworlds.com/designing-interactive-syst...
But the happy times
didn’t last forever
Complexed structures
raise the server load
Example: Automated
Chicken Cooking Machine
Red stone circuits
http://gaming.stackexchange.com/questions/16208/what-are-some-tips-for-mastering-redstone-circuits
http...
CPU: Not enough!
512MB: Not enough!
Annoying delay which
disturbs the playability…
So I first planned
buying a home server
THEN SUDDENLY
I remembered what
I’m doing at HDE
Use the cloud
and save money!
Solution:
EC2 Spot Instances!
m3.medium
vCPU: 2
RAM: 3.75GB
$0.101/h
for an on-demand
m3.medium instance
m3.medium for about $0.01/h
(today’s price)
The price varies over time
but spot instances are
generally very cheap!
My First Plan
• When I want to play,
• API bids for a spot instance
• Spot instance boots up and mounts a particular
EBS, ...
But this is difficult
• How do I control this from outside of EC2?
• I want to casually switch the server on and off
Auto Scaling Group
Auto Scaling Group
Example: Min:1 Max:4
On low load
On high load
But we don’t auto
scale at all ;-)
We scale manually
Auto Scaling Group
Min:1 Max:1
Min:0 Max:0
When we are playing
minecraft
When we are not playing
minecraft
Me
Kid
And made a UI for kids
Capacity: 0
Started: No

Up: No
“Stopped”
“Start”
Capacity: 1
Started: No

Up: No
“Told the server
to start up.”
“Please stand
by.”
Capacity: 1
Started: Yes

Up: No
“The server

started.”
“Wait for 

a minute.”
Capacity: 1
Started: Yes

Up: Yes
“It’s running.”
“Stop”
Python + boto + Flask
Lines: 74(excluding HTML templates)
So easy!
I only pay 10-30 JPY
per a week for this!
社長だけど

かなりケチです
Other tweaks
• I’m actually using “desired capacity” feature of auto
scaling group to control the number of the instances
...
This technique is also useful
when you have to keep a
non-critical server up
Happy Mining!
Upcoming SlideShare
Loading in...5
×

Building a minecraft server for a family using Auto Scaling Groups

2,211

Published on

2 Comments
4 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,211
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
2
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Building a minecraft server for a family using Auto Scaling Groups"

  1. 1. Kazuhiro Ogura @goura 小椋 一宏
  2. 2. Building a Minecraft Server for Families (Using AutoScalingGroup) Kazuhiro Ogura HDE, Inc.
  3. 3. Of course you know about Minecraft
  4. 4. http://www.gamespot.com/articles/minecraft-passes-100-million-registered-users-14-3-million-sales-on-pc/1100-6417972/
  5. 5. http://www.wired.co.uk/news/archive/2014-03/13/minecraft-cloudmaker
  6. 6. I’m playing this game for about a year
  7. 7. …with my 7-years old son
  8. 8. Minecraft is not an MMO
  9. 9. But It’s an MO (Massive Multiplayer Online Game)
  10. 10. P2P Play PC (Host) PC (Guest) PC (Guest) PC (Guest)
  11. 11. Not for a kid/dad who doesn’t live in the same timeframe
  12. 12. Dedicated Server Server (Host) PC (Guest) PC (Guest) PC (Guest)
  13. 13. minecraft_server.jar • Free • Distributed as a jar file (Need JRE to run) • Official version from Mojang, 
 open source clone also available (Bukkit)
  14. 14. So I started like this
  15. 15. Server (Host) My PC (Guest) Kid’s PC (Guest) Sakura VPS RAM: 512MB Daytime
  16. 16. Server (Host) My PC (Guest) Kid’s PC (Guest) Sakura VPS RAM: 512MB Nighttime
  17. 17. Server (Host) My PC (Guest) Kid’s PC (Guest) Sakura VPS RAM: 512MB Weekends
  18. 18. This worked
 for a while
  19. 19. Kid builds in daytime, dad mines at night
  20. 20. Kid builds in daytime, dad mines at night
  21. 21. On weekends we explore scary places together Image taken from: http://www.fromstrangeworlds.com/designing-interactive-systems-for-storytelling/
  22. 22. But the happy times didn’t last forever
  23. 23. Complexed structures raise the server load
  24. 24. Example: Automated Chicken Cooking Machine
  25. 25. Red stone circuits http://gaming.stackexchange.com/questions/16208/what-are-some-tips-for-mastering-redstone-circuits http://www.minecraftforum.net/topic/1226503-redstone-block-with-behavior-that-allows-parallel-wiring/
  26. 26. CPU: Not enough! 512MB: Not enough! Annoying delay which disturbs the playability…
  27. 27. So I first planned buying a home server
  28. 28. THEN SUDDENLY
  29. 29. I remembered what I’m doing at HDE
  30. 30. Use the cloud and save money!
  31. 31. Solution: EC2 Spot Instances!
  32. 32. m3.medium vCPU: 2 RAM: 3.75GB
  33. 33. $0.101/h for an on-demand m3.medium instance
  34. 34. m3.medium for about $0.01/h (today’s price)
  35. 35. The price varies over time
  36. 36. but spot instances are generally very cheap!
  37. 37. My First Plan • When I want to play, • API bids for a spot instance • Spot instance boots up and mounts a particular EBS, via cloudinit script • Instance registers itself on a DNS to make it easily accessible from the client
  38. 38. But this is difficult • How do I control this from outside of EC2? • I want to casually switch the server on and off
  39. 39. Auto Scaling Group
  40. 40. Auto Scaling Group Example: Min:1 Max:4 On low load On high load
  41. 41. But we don’t auto scale at all ;-)
  42. 42. We scale manually
  43. 43. Auto Scaling Group Min:1 Max:1 Min:0 Max:0 When we are playing minecraft When we are not playing minecraft Me Kid
  44. 44. And made a UI for kids
  45. 45. Capacity: 0 Started: No
 Up: No “Stopped” “Start”
  46. 46. Capacity: 1 Started: No
 Up: No “Told the server to start up.” “Please stand by.”
  47. 47. Capacity: 1 Started: Yes
 Up: No “The server
 started.” “Wait for 
 a minute.”
  48. 48. Capacity: 1 Started: Yes
 Up: Yes “It’s running.” “Stop”
  49. 49. Python + boto + Flask Lines: 74(excluding HTML templates) So easy!
  50. 50. I only pay 10-30 JPY per a week for this!
  51. 51. 社長だけど
 かなりケチです
  52. 52. Other tweaks • I’m actually using “desired capacity” feature of auto scaling group to control the number of the instances • Instance uses dynamic-DNS to bind it’s IP to a fixed FQDN • Instance watches the Minecraft directory and terminates itself (sets capacity to 0) if there are no activities for an hour • Anyway the server kills itself after certain hours
  53. 53. This technique is also useful when you have to keep a non-critical server up
  54. 54. Happy Mining!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×