Two of the key design principles of Boxfuse are reliable and fast generation of minimal immutable images and outstanding integration integration with AWS.
Today we're going to leverage both together to take things even further.
AWS' native format for images is the AMI, the Amazon Machine Image. It is a central building block of EC2. Every single EC2 instance you launch is based on an AMI. And Boxfuse makes it really easy to create them.
Immutable images such as AMIs also have the great advantage that they really simplify scaling. Whether you have to set up 1, 10, 100 or 1000 instances, all you need to do is launch that number of identical copies from the same base image and you're done. Refreshingly simple.
In fact Boxfuse has enabled you to do this for a while. Regardless of whether you want to scale horizontally, vertically or both, Boxfuse simply lets you do:
> boxfuse scale myapp -env=prod -capacity=7:t2.large
This will effectively launch 7 new t2.large EC2 instances of your app, and once the healthchecks have passed, Boxfuse will terminate any previous deployments and perform a zero-downtime transition.
While this is great for guaranteeing you always have the required amount of processing power available, it forces you to guess your capacity needs in advance, which means that at certain times you may be paying for more capacity than you actually need.
Today we are introducing Boxfuse support for AWS Auto-Scaling. You can now let AWS automatically optimize the scale of your system based on the current load.
All you need to do is drag a slider to indicate the minimum and the maximum number of instances you want, and specify at which CPU usage thresholds the scaling activities should happen, and click Scale. Boxfuse and AWS will take care of the rest.
In this example here, Boxfuse will automatically configure AWS CloudWatch to monitor the CPU usage of your instances. Boxfuse will also automatically configure Auto-Scaling to kick in as soon as the rolling average over a period of 300 seconds exceeds 75%. Auto-Scaling will then start provisioning additional EC2 instances up to a maximum of 10. If CPU usage instead drops to 25% or below, EC2 instances will be terminated down to a minimum of 2.
The same can of course also be specified from the command-line:
> boxfuse scale myapp -env=prod -capacity=2-10:t2.micro:cpu25-75:300 Successfully configured myapp to auto-scale between 2 and 10 t2.micro instances based on average CPU load over 300 seconds, scaling in at 25% and below, scaling out at 75% and above.
And voila! Done! Auto-scaling has never been this easy!.
Tip: To best optimize your budget with your actual usage, start with auto-scaling the smallest type of general purpose instances like t2.micro and only move to larger or more specialized instances if needed.
Immutable Infrastructure makes scaling fast and reliable. However having fixed capacity for your system requires you to guess your needs in advance. It also means that at times you'll potentially pay more than you should.
Starting today, Boxfuse can now automatically configure AWS to auto-scale your application based on average CPU usage. AWS will add or remove capacity from the system fully automatically based on the current load, so that you never have to worry again about paying for more than you actually need.
This is available today at no extra cost to all paid plans.
Have fun and keep on deploying JVM applications to AWS with ease and pleasure!
And if you haven't already, sign up for your Boxfuse account now. All you need is a GitHub user and you'll be up and running in no time. The Boxfuse free plan aligns perfectly with the AWS free tier, so you can deploy your JVM application to EC2 completely free.