Objective of the Game
The objective of the game was to host and scale a GO binary file. The GO binary takes in a hash value as a GET variable and then returns a different hash if successful. The GO binary took 4 seconds to process the request and tied up the server for those 4 seconds, making the server only possible to process one request at a time. There were also other wrenches thrown into the mix such as the setup of the infrastructure within AWS, such as being limited to only 20 instances because of the subnet for IP’s.
Overall objective was to serve the most request for the lowest cost on infrastructure so profit would go up.
Our Strategy
I worked on a team with 3 other people. We initially had the idea of spinning up additional instance behind our ELB (Elastic Load Balancer). This method would have been the most obvious and probably what most teams went with. We also decided to implement CloudFront to serve and requests that could have possibly been the same hash.
Ultimately we knew that we had to do something different to get ahead, so we decided to head in a little different direction using Docker and HAProxy. The theory behind this idea was the same as balancing instances behind an ELB, but the benefit of using Docker is that we could setup multiple containers on a single instance. Using HAProxy as another container on the instance allowed us to distribute the incoming requests across a single instance to the other containers that had the GO binary on it.
Result
We ended up being able to put 27 containers with the GO binary on a single instance and this is when we started to really see our profit soar. After about an hour and a half into the competition we were in probably 99th place out of 100 teams. But about 2 hours into the competition we had a single instance running with Docker and HAProxy and we started moving up the scoreboard very quickly.
We ended up 3rd place on the scoreboard, but AWS posted on Twitter that we were the legitimate winners. The reason is because the 1st place team setup a proxy to all of the other teams to handle their requests. The second place team de-compiled the binary file and removed the 4 second sleep.
AWS Re:Invent Gameday 2015 Info
My Team: fluffyunicorns
http://scoreboard.unicorn.rentals/team.html?team=996523324924
http://scoreboard.unicorn.rentals/