16

Amazon's EC2 billing page says that fractional hours are billed as whole hours. But does anyone know if that means they round up the hours at the end of the month, or round up the hours at the end of each instance run?

E.g. if in one billing period I have 2 instances running for 5 minutes each, is that one hour or two hours?

3
  • 8
    How is this off-topic? "Questions on Server Fault are expected to generally relate to system administration, servers, or professional desktop IT" ... seems like it hits all three of those.
    – Hank
    Mar 10, 2011 at 21:54
  • 8
    Lame for closing this topic. This is within the domain of system administration -- being able to accuratly estimate costs happens in the "real world". Apr 13, 2011 at 21:21
  • 2
    The answer is 2, but why is it off topic?
    – ThinkCode
    Sep 29, 2011 at 14:34

4 Answers 4

20

From the Amazon Elastic Compute Cloud User Guide for API Version 2010-11-15

Each time you transition an instance from stopped to started, we charge a full instance hour, even if transitions happen multiple times within a single hour.

This can be seen here under the section titled "Stopping and Starting Instances"

So I think ajdecon is pretty clearly correct in this case.

1
15

Each instance starts billing as soon as it's started. It rounds up to the hour - so if you start it and run it for five minutes and stop it, you get billed 1 hour. If you run it for 55 minutes and stop it, you get billed for 1 hour. If you run it for 65 minutes and stop it, you get billed for 2 hours.

If you stop and start the same exact instance 5 times in an hour, you get billed for 5 hours! Beware.

The billing goes from the time the instance entered the started state and till it enters the stopping state. So as long as you tell it to stop, you're OK, it doesn't have to get all the way to stopped. You can see the instance start time in the instance metadata and through the console.

There is no averaging across instances - each instance is completely separate from a billing point of view. So if you run two instances for 5 minutes each, that's 2 hours of bill.

We implemented a highly dynamic compile cloud product and so after verifying all these details with our Amazon account team we wrote a reasonably complex scaling algorithm that when it runs and determines how many instances are running and how many we really need, looks for instances near the end of their hour lifecycle to drop and never drops anything unless it's in the 50+ minute mark of a given hour.

7

EC2 rounds up. 2 instances for < 1 hour = 2 hours.

-1

I think amazon calculates the whole month usage based on what instance type you run.

Thus, two medium instances running for a total of less than 1 hour will amount to 1 hour billing while one medium with one large will amount to 2 hours billing.

Easily tested, just start 2 micro and terminate them within half an hour each and see what the account activity says. If you have a new "free tier"-account you're entitled to ~720 free micro hours each month so testing will end up costing you nothing.

1
  • 1
    This is incorrect, see accepted answer Oct 3, 2016 at 10:35

Not the answer you're looking for? Browse other questions tagged .