From Rackspace to Engineyard: Diary of a moving Rails app
About a year ago we decided to rebuild gamezone.com from scratch since it was built on Expression Engine and not only it had poor performance but it also was very hard to add features to.
As my weapon of choice Rails was used and with a very small, but great, team we were able to do it all in about 3 months.
Once we had the project working the question came up on where to actually host it. Gamezone is a site with a lot of traffic and the hosting is really critical.
We had a couple servers with Rackspace already and we decided to use their cloud for this site too. Setup with them is always a breeze. The load balancer, app and db servers were up in minutes and after the standard configuration the site was ready for testing.
We used LoadStorm to load test the servers and it worked flawlessly.
The problem started when we had to scale the service from the initial load to support the additional users that started to join after we started to add more features.
We had some scripts but it was very labor intensive to add servers or move stuff around. Moreover we started to run into some issues with Rails scaling and as we started to add more caching layers the pain grew. That’s why we decided to shop around.
I’ve been hearing great things about Engine Yard for a long time so we decided to take them for a spin. And since they have a free trial account it was even better.
The deploy process is really easy and their GUI/CLI tools are great so we were up and running in no time. You just pick the packages that you want to use and boom they are just there. I know that this is just a bunch of chef recipes in the backend but it is just beautiful how it works.
It was all very rosey until we decided to proceed and actually move to their services. Setting up the cluster was also a breeze just like the demo. The only problem was that some servers didn’t provision correctly so we had to terminate them and re create them, but no big deal.
After we had everything setup I noticed something: every time you deployed code that needed a migration the maintenance page would go up. I don’t know about you but I cannot have the server down for 5 minutes or more waiting for the migration to happen.
I contacted EY support and, always graciously, told me that Rails couldn’t handle rolling migrations but you could disable this at your own risk. Scratching my head a bit since I’ve always done migrations on live apps without problems, I decided to disable the “feature” (here is the code). Lo and behold nothing happened and we could do rolling migrations just fine.
Once that was settled we moved the DNS records and all went pretty smooth from there.
We had two minor issues worth mentioning. The first one was that with Rackspace we were used to having 4 virtual cores per server and now we have 2 (on the Medium High CPU instances) so we had to use large instances for the DB servers. The second one was that we had custom config settings for nginx and we didn’t know how to “keep” them. You can actually create “keep” files that engineyard won’t get rid of every time you apply the configuration.
If you have any questions about Rackspace, Engineyard or the process please comment below and I’ll do my best to answer!





