Shutting down unutilized EC2 instances

Using AWS is easy and very cost effective; however there are ways to make it even more cost effective by shutting it down when not needed. This might seem fairly obvious but until now there has not been an easy and effective way to address this issue. Below I have mentioned 2 options, both behave differently based on what you’re trying to achieve.

Case 1

There are times of the day when the server activity goes down e.g. during the holidays or when the project is in doldrums. It makes sense not to have the server running during these times. The problem is that we can’t predict when these events will occur. In these cases it makes sense to shut down the server if it hasn’t been used for a certain amount of time. Enter Cloudwatch alarms these alarms can be set in the management console itself against the instance and are configurable to the instance itself. This means that some instance can shut down when the CPU is idle for more than 1 hour while other could wait 24 hours before they shutdown.

http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/UsingAlarmActions.html

The above link shows you how to set up the alarm step by step.

Case 2

The second approach has to do with regular intervals, assuming there is regular office timing or cyclic patterns to the usage of the system you can shut down or start the server as required. This means that the office which works 12 hours a day could see their AWS cost come down by up to 50% simply by shutting down the server when no ones in the office.

The below tools is a great way to manage the uptime of the server it contains an inbuilt scheduler and will automatically detect the instances belonging to the Amazon account. It also allows you to group the servers and create a common schedule which is useful for development and test environments.

http://blog.simple-help.com/2012/03/free-ec2-scheduler/

As part of installing the software you need to provide your AWS key and secret key which is used by the application to talk to AWS and list the current EC2 instances available.

If you’re not sure of what your keys are then visit this link.

Please Consider Subscribing

Leave a Reply