AWS migration


Autoscaling AWS cluster with Elastic Beanstalk

From Heroku to AWS

The client's mission statement was to migrate a Laravel backend (admin + api) from Heroku to AWS. Heroku's dynos became increasingly expense, but moreover, the overall system suffered from instabilities.

In AWS we created a production and a test environment for this specific app:

  • An autoscaling Elastic Beanstalk app, with separate components for API, admin and 'worker'
  • A shared application load balancer to terminate SSL and redirect all traffic to the appropriate targets
  • Deployment pipelines for continuous delivery/integration, with immutable deployments without offline time
  • A redundant Elasticache/redis cluster

The deployment pipeline can be triggered by a simple git push. The database setup was pre-existing and already running on AWS.

Load / Stress testing

To configure and evaluate the new cluster, we executed some stress tests on the old and new environments.

We used the first test to configure the machines accurately so it would not suffer from memory problems even under the heaviest load.

Results of the other tests showed the new cluster was 30% more performant than the Heroku setup.
At the same time, the Heroku setup reached critical levels, while the AWS setup did not even enter the autoscaling phase.

Cost efficient

Savings compared to Heroku are estimated at 60%.

For even higher scalability we deploy 'spot instances' (besides a stable 'on demand base') - effectively, unused capacity at AWS is used to create more redundancy offered at a much lower price than the on demand price.

Post date: March, 2021

Know the application

For this project I was able to use my pre-existing knowledge of the used framework (the popular Laravel framework in php). Especially to evaluate and fine-tune the performance of the stack.

Some specs

  • Application framework: PHP Laravel
  • Nginx
  • php-fpm tuned to the application and instance size
  • Code Pipeline with CodeCommit (VCS), CodeBuild project and CodeDeploy
  • Docker image (in ECR) for the build process
  • Environment specific configuration strategy in the build process
  • Daemonized workers using supervisord

AWS Certified Devops Engineer

I am currently taking the AWS Certified DevOps Engineer course to enhance my knowledge in infrastructure automation and CI/CD.

Load en Stress tests

Test your cloud infrastructure with K6

Gobot RPI simulator

A GPIO pin simulator for RPI written in Golang

Reactions Craft CMS plugin

A new Craft CMS plugin to add Facebook style reactions

Vertaal component

A translation component in Symfony, with API and control panel.

Craft plugin

We launched a Craft CMS 'poll' plugin in the plugin store.