With on-demand infrastructure available at anyone’s fingertips, AWS provides you with the ability to run any type of workload you may require both quickly and easily. And with a pay-as-you-go model, you can benefit greatly by avoiding capital expenses. But even though having only operational costs can be of much help (especially for smaller startups), quick access to an almost unlimited amount of resources can easily lead to over provisioning, especially when it comes to EC2 instances.
On top of that, you will actually be paying for any resource that is up and running, whether you are actually utilizing them or not—so having idle instances means that you will be spending money unnecessarily. By simply stopping your unused compute resources you can make huge savings on your infrastructure, and that is exactly why Amazon released a new service called Instance Scheduler early last year.
In this article, we will take a look at Instance Scheduler and its advantages and disadvantages, but we will also consider an alternative offered by N2WS Backup & Recovery.
AWS Instance Scheduler
Instance Scheduler is a solution provided by AWS that allows you to custom configure automatic starting and stopping of your Elastic Compute Cloud (EC2) and Relational Database Service (RDS) instances. AWS Instance Scheduler is built using a couple of different services. It involves CloudWatch which is utilized to trigger Lambda functions, and those functions will start and stop your instances. Everything is logged into CloudWatch, and DynamoDB is used for storing configurations. This entire setup is provisioned using CloudFormation template, and looks something like this:
When provisioning the CloudFormation stack, you will need to define various details for you scheduler. After you set up the AWS account and the region to be used, you will also need to create a custom tag that will be used to define which EC2 and RDS instances are to be scheduled—the tag value you specify will be used for uniquely identifying the desired schedule you want to apply. You will have to add these tags to each instance later yourself. Lastly, you will need to set up the custom intervals for your CloudWatch events, which will trigger the Scheduler’s Lambda function.
The entire configuration is stored in a DynamoDB table, and is retrieved by Lambda prior to each run. When the function is invoked, it will check the state of each resource that matches the tags and compare it to the desired state based on the defined schedule configuration table—if there is a difference in a state, it will start or stop instances in order to match it.
When configuring schedules, you will specify one or more periods, and optionally, a time zone to be used. You can also choose an instance type, so that the schedule only applies to a specific group of instances. Another option you can set is enforced field, which when set to true will make sure that none of the tagged instances are started or stopped manually outside of the defined schedule. If you do start an instance by hand, the scheduler will stop it, and vice versa. For a full list of configuration options, go here.
Advantages and Disadvantages of AWS Instance Scheduler
AWS Instance Scheduler is a good solution for making sure your instances are not running at all times. This can significantly reduce your monthly bill, especially if you don’t utilize your compute resources most of the time. Instance Scheduler can also be used with multiple AWS accounts, and provides a command line interface (CLI) for configuring your schedules.
On the other hand, Instance Scheduler consists of multiple components which are deployed using the CloudFormation template. This template is premade, but in order to properly provision all the resources as well as configure all the details required, some AWS expertise is required—everything relies on precise information, from proper tagging to various other settings involved. On top of that, maintaining all the components will create an overhead and any troubleshooting will be far from simple—so unless you have an experienced Operations team within a company, this might be too much to handle. And, of course, you will have to pay for each of the services Instance Scheduler is utilizing, so expect charges for Lambda, CloudWatch metrics, and DynamoDB read and write capacity.
Another thing to consider is that all your configurations are stored in DynamoDB, so any change that you want to make requires updating a CloudFormation stack. You can’t simply make minor changes by editing what you need by hand—otherwise you can create some conflicts down the line.
N2WS Backup & Recovery as an Alternative
N2WS Backup & Recovery is a cloud native tool offered by N2WS, with a primary focus on allowing you to quickly back up your data, as well as restore it in any region or even AWS account, when necessary—which helps your data to become a lot less vulnerable to disaster events. But this is not all that this tool provides, as N2WS Backup & Recovery is constantly updated with new features and improvements. When v2.5 was released, Resource Control was introduced—an alternative to AWS Instance Scheduler.
While Instance Scheduler is a decent solution to save money by preventing your instances from running at all times, it does require a significant amount of work to set up, as well as prior experience working with AWS. On the other hand, N2WS Backup & Recovery requires almost no experience with AWS, and can be setup quickly and easily—you can have your schedules set up in no time. By managing all you instances from a single location, you don’t have to rely on any other service either—instead all the necessary work is done for you behind the scenes, and all you need to do is define the groups of instances and choose when you want them to start or stop. You can even start or stop all your group-defined instances with a single click if necessary, which many customers utilize.
N2WS Backup & Recovery: Many Other Benefits
N2WS Backup & Recovery has been growing exponentially as a tool, and some of its features can be extremely useful. For example, it allows you to take your EBS snapshots and archive them directly to S3, which can save you up to 60% on storage cost. Another great feature is VPC capture and clone, which provides a quick and simple way to replicate your entire VPC in another region, saving you a lot of time during disaster recovery. N2WS is always expanding its support range for APIs via Command Line Interface (CLI), providing an even easier way for you to automate these processes.
Summary
When it comes to AWS, cost control is something every company is looking at, and Instance Scheduler is a tool to help you do just that. But when all the additional cost and complexity is considered, it is far from being the most elegant solution out there. N2WS Backup & Recovery is a great alternative to this, as it allows you to do everything Instance Scheduler has to offer, and there is a lot less work involved. And with all the other features being offered, as well as the updates coming in regularly, it is a tool you should definitely consider whether you are running a small startup or a large enterprise environment.