Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as off topic by Ben Pilbrow, Iain, jscott, Scott Pack, John Gardeniers Mar 10 '11 at 21:38

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

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. – Henry Jackson Mar 10 '11 at 21:54
Lame for closing this topic. This is within the domain of system administration -- being able to accuratly estimate costs happens in the "real world". – Richard West Apr 13 '11 at 21:21
The answer is 2, but why is it off topic? – ThinkCode Sep 29 '11 at 14:34
up vote 13 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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