Minecraft Deployment on Amazon Web Services Micro Instance

A fun little group project we recently worked on was setting up a Minecraft server on the FREE tier of the Amazon Web Services EC2 service.  The creative components to this project are all held in the Minecraft world itself, called Fallen Skies.  This world was a labor of love created by a few young crack-shot crafters that dedicated weeks of time creating, configuring, testing and generally having fun sharing their environment with their brothers and sisters on a local neighborhood network.

That is where I got involved.  The team began investigating how to publish the world to the cloud for the crafting community to easily consume and create the possibility of ‘in-app’ purchases to make a little return on the time they invested.  The challenge was to take a cost conscious approach to the deployment while balancing environment performance and stability.

After researching cloud providers (detail to be added at a later time), and minimum virtual environment specifications, the decision was made to utilize the AWS Free Tier Micro Instance for the initial rollout.

The detail in this post will account for the step by step process taken to successfully create the correct AWS EC2 instance and properly deploy and monitor the Minecraft world.  For now, have a quick look at the Fallen Skies video advertisement created by the authors.

Cloud Instance Cost Analysis and Decision:
There are several cloud vendors with competitive instance cost and performance attributes, but Amazon Web Services is the only infrastructure cloud vendor I was able to find offering a Free Tier of service (for twelve (12) months).  After discovering this option, along with ensuring the environment specifications offered in the Free Tier would suffice for our project, the decision to move forward with AWS for the initial project launch was locked in.  We recognized the performance of the Micro instance was not going to be ideal, but we were willing to accept the risk as long as we could achieve a sustained, acceptable level of concurrent connections.

Below is the analysis of the Free vs the Entry level EC2 instance cost over time.

Micro Instance 613 MiB of memory, up to 2 ECUs (for short periodic bursts), EBS storage only, 32-bit or 64-bit platform

Instance Family: General purpose
Instance Type: m1.small
Processor Arch: 32-bit or 64-bit
vCPU: 1
ECU: 1
Memory (GiB): 1.7
Instance Storage (GB): 1 x 160
EBS-optimized Available: –
Network Performance: Low

Instance Family: General purpose
Instance Type: m1.medium
Processor Arch: 32-bit or 64-bit
vCPU: 1
ECU: 2
Memory (GiB): 3.75
Instance Storage (GB): 1 x 410
EBS-optimized Available: –
Network Performance: Moderate

Had we elected to utilize a pay-for instance, we would have elected to utilize the On-Demand EC2 instance, test market adoption, then migrate to a one year investment to lock in a lower hourly environment rate.  The following table breaks down the instances under consideration over time.

aws-chart1

So, what has the AWS EC2 instance usage been like since the Minecraft world was launched and users began logging on?  Below is a summary table of the usage and any associated costs for the past two months (September 13, 2013).  As you can see, the usage is nowhere near the allowable usage limits of the AWS Free Tier.

AWS Service Charges
Amazon Elastic Compute Cloud
$0.00
US West (Oregon) Region
Amazon EC2 running Linux/UNIX
$0.00 per Linux/RHEL Micro Instance (t1.micro) instance-hour (or partial hour) under monthly free tier 294 Hrs 0.00
Amazon EC2 EBS
$0.00 per GB-month of provisioned storage under monthly free tier 3.256 GB-Mo 0.00
$0.00 for the first 2 million I/O requests under monthly free tier 107,881 IOs 0.00
AWS Data Transfer (excluding Amazon CloudFront) $0.00
$0.000 per GB – data transfer out under the monthly global free tier 0.041 GB 0.00
$0.000 per GB – data transfer in per month 0.013 GB 0.00
$0.000 per GB – data transfer out under the monthly global free tier 0.000444 GB 0.00
$0.00 per GB – US West (Oregon) data transfer from US East (Northern Virginia) 0.000082 GB 0.00

 Setup and Configuration
Below is a list of commands and scripts created in the EC2 Micro environment.  The Micro Instance created was a 64 bit Linux environment.  Since we were managing the AWS EC2 environment from Windows, we need to download and install WinSCP (Windows Secure CoPy) for project file transfers.  The AWS java virtual console allowed our team to connect to the console of the Linux instance.

The following Linux command were utilized to configure the Minecraft environment on the AWS instance:
screen – attach/detach
mkdir [minecraft-root]
i #!/bin/bash
# Minecraft Server startup script
java -Xmx500M -Xms500M -jar minecraft_server.1.6.2.jar nogui
java -Xmx500M -Xms500M -jar “CraftBukkit 1.6.2-Dev.jar” nogui

:w start.sh
:q!
chmod +x start.sh
screen -DR
cd [minecraft-root]
./start.sh
screen -DR
cd [minecraft-root]/[server1]
./start.sh
tmux new-session -s [minecraft-session1] -n [minecraft-session1]
cd [minecraft-root]
./start.sh
<CTRL-b> d
end SSH, try:
tmux attach -t [minecraft-instance-name]
(esc)
:w!
:q!
/home/ec2-user/[minecraft-root]/[server1]
vi server.log
:q!
Setting Up Swap Space for the Minecraft Java Instance
The most critical technical component of this project was to setup enough temporary swap space on the AWS Micro Instance for Minecraft to properly run.  The following commands successfully applied the Swap Disk:

dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo mkswap /swapfile
sudo swapon /swapfile

sudo vi /etc/fstab
/swapfile swap swap defaults 0 0
(esc)
:w!
:q!

Minecraft Server Clustering for High Availability
Because we decided to run this project in a “Proof of Concept” mode, we did not investigate server clustering for high availability.  But, if we choose to relaunch at a later date, this requirement may come into scope.

The Advertising Campaign
Once the Minecraft server was launched and tested for stability, the crafting team took the step of advertising their server on the following site:
http://minecraftservers.org/
Once the server was published, within 24 hours, the server received over 80 connections from new Minecraft users.  The crafting team then discovered the server became unstable due to third party plugin incompatibilities.  The server’s instability may have resulted in many users becoming inpatient and not interested in returning, but over the days following, the crafting team made changes to improve server stability, and the environment has been stable since that time.  When the server is up and running, there are several users that have become regular customers of the world, which is a rewarding feeling, much deserving of koodos to the crafting team!

There are additional steps that could be taken to promote awareness for the new Minecraft server
1. Post the server to other popular Minecraft server sites, such as: http://www.planetminecraft.com/resources/ser

vers/
2. Post a ‘Minecraft server launch event’ as a tweet and/or post on your social networks like Twitter and Facebook.
3. Author a highly descriptive video narration of the gameplay and post to a YouTube channel.

 

The next update to this post further detail for the AWS Linux setup, configuration, and Minecraft deployment.

Great job team!

Bookmark the permalink.

One Comment

  1. Pingback: Minecraft Server High I/O Will Cost You on the AWS Free Tier - just4fun

Leave a Reply