How we divided our hosting costs by 10 using Rancher (and Docker)
Docker is quite popular right now. I found it’s best friend 8 month ago (still in beta at this time), Rancher. I needed to try Docker, because everyone was talking about its advantages, and I thought it could resolve my pains as a developper.
However, I didn’t know that Docker and Rancher will change my everyday developer’s life.
We’re a young startup in the south of France called SchoolMouv. Our main aim is to create an online educational platform where users can work and learn their courses using our videos, lessons and quizz. We’re working hard to become experts for providing high-quality educational resources online, especially for videos.
We’re 5 technical guys. 2 frontend developers, 2 backend, and one DevOps architect. Installing our entire solution, workers, APIs, frontends etc. is time consuming. It could take 2 to 3 days to have a clean and working dev environment. Don’t laugh, please…
Our architecture at this time was quite simple. 1 physical machine = 1 app. Stop laughing again ! :). We got about 20 servers at this time.
Moreover, everything was manual. Deployments were hardcore, time-consuming and stressful.
When we decided to hire our first engineer, I started to learn and use Docker. I knew installing the entire solution on his machine will be a huge loss of time. So I started writing my dockerfiles. Today, when a new tech guy enters the team, a simple docker-compose up -d, builds the entire solution in less than 15 minutes.
Docker is the guy who killed the “Please follow the installation instructions. Make sure you met all the requirements before starting”….
Some of our workers are using PhantomJs to render beautiful PDF of our text lessons. And obviously, Phantom does not provide the same binaries for Mac, Windows and Linux. Everything was working pretty fine on my MBP… Until I deployed my worker to a Ubuntu-based server.
That’s the second thing that motivated my choice. With Docker, you’re sure that you current dev, test and production environnements will be the same and that your code and its dependencies will work as expected.
Since that time, we moved from our previous software architecture and we exploded our apps into services. Right now, 1 service = 1 docker image
What about production ?
When you read these kind stuff, you’re like, oh, great, OMG, no?, seriously?, awesome! Yes, everything was working on our machines. But what about migrating our entire architecture using Docker ?
Rancher, the docker wedding planner
Rancher can be defined as a complete management platform for Docker containers. It provides a beautiful graphical interface, a solid API for playing with your containers, a complete networking system to link them, and thus even if you’ve a ton of physical machines at different locations.
Working with Docker is great, but we were a bit afraid to deploy these containers in production. How many containers do we have to deploy on the first host, on the second and on the third ? How’re they goin’ to communicate? How to scale these containers? Do we have to manually create load balancers?
Yes we read the docs about docker-swarm. Yes docker-swarm is a great tool but it’s not a container management platform. At SchoolMouv, we love Rancher. It provides all the things we need: container upgrades, scalability, load balancers, networking facilities and much more.
With Rancher, you deploy, run and manage containers like a pro
That’s it. Our entire architecture is based on Docker and managed entirely by Rancher.
- We have 10 services, and 15 running containers
- We’re doing at least one deployment a day.
- It takes about 5 minutes to deploy a new version
- We went from 20 physical machines to 5, and it’s quite enough.
- When a physical host is out of memory, rancher automatically moves our containers to another one
- If we want to scale, we just click the + button
…we divided our infrastructure cost by 10!
There’s still a lot of things to do:
- Automatic rollback based on container failures when deploying new versions.
- Continuous integration and deployments. Images should be automatically built and deployed.
- Complete logging and alerting system about Docker containers (We think about using Prometheus thanks to SoundCloud tech team)
If you liked this article, share ! I want to do a special thanks to the tech guys in SchoolMouv who built with me this complete new architecture, and obviously all the Rancher team. Please follow https://twitter.com/bokal, our fantastical DevOps architect.
Hey! Drop me a line in the comments if I’ve made any mistakes or can be helpful in anyway! :).
I’m on LinkedIn: https://www.linkedin.com/in/trvide/ for those of you wanting to connect!