0

When I use AWS autoscaling to launch instances, am I being charged for the full hour every time I launch an instance?

Lets say my auto scaling is being triggered every 20 minutes, followed by launching 6 instances that runs a job that takes 10 minutes to execute, and then the instances terminate. So in an hour range I will be launching 18 machines in total.

Will I be charged for 18 hours, or 180 minutes (18 * 10 minute to execute)?

3

In short: yes.

With Amazon EC2, you pay for each instance-hour and is rounded up. So for example:

  • An instance is created at 12:01 and is terminated at 14:32. This equals 2 hours and 31 minutes, which equals three hours of usage.
  • An instance is created at 12:03 and is terminated at 12:48. This equals 45 minutes, which equals one hour of billed usage.
  • An instance is created at 13:43 and is terminated at 14:18. This equals 35 minutes, which equals one hour of billed usage, even though the instance lifetime spans two hours.
| improve this answer | |
  • That's a bummer, it's makes autoscaling very expensive for a lot of use cases - useful only for long running jobs – Ofer Velich Oct 12 '15 at 20:56
  • 2
    @OferVelich Short-running jobs are more what AWS Lambda or AWS Elastic Container Service are for. Or just keep the instance on and run the jobs on the already-running instance. – ceejayoz Oct 12 '15 at 21:00
  • 1
    This answer doesn't seem to address what happens when AWS terminates your spot instance involuntarily. The final (uually partial) instance-hour in which AWS (not the user, not auto-scaling, not the instance itself) terminates a spot instance is not billed. aws.amazon.com/ec2/faqs/#spot-instances – Michael - sqlbot Oct 12 '15 at 23:45
  • 2
    @Michael-sqlbot the question didn't ask about involuntary termination of spot instances, so it's hardly surprising that the answer doesn't address it. – womble Oct 13 '15 at 1:40
  • 1
    @womble, fair point. Re-reading my comment, it comes across as being critical of the answer, and I really did not intend that. +1. Involuntary termination is always a possibility though, and seemed to me like a noteworthy exception to "rounded up" that bears mentioning in discussion of the cost of spot. – Michael - sqlbot Oct 13 '15 at 2:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.