How AWS Per Second Billing Differs for Spot vs On-Demand

How AWS Per Second Billing Differs for Spot vs On-Demand

When Amazon Web Services announced per second billing for Linux EC2 a couple of weeks ago on September 18, 2017, I think we all applauded. Well, maybe not Google and Azure, but most cloud consumers anyway. One of the underpinning philosophies behind cloud was “pay only for what you use” and what made sense in 2006 was starting to look archaic in 2017. We knew this could only save us money (check out our savings calculator)

Per second billing went live this week on Monday, October 2nd. We have now had a few days to analyze and get into the details of exactly what this means, especially in terms of the details of how it affects Spot bidding strategies and charges incurred with Spot. None of which was addressed in any detail in the public press releases or in the documentation on AWS (at least as of today), other than Spot would also move to per second billing.

In particular, we had a few of specific questions on how this would be implemented for the unique characteristics of Spot markets that could dramatically affect our bidding strategy employed for our clients:

Spot Related Questions

Which price is used to calculate the pro-rated per second price?

Would it be the one at the beginning of the hour (as done previously for full hour charges) or would it apply the changes to the price, which can sometimes vary substantially minute by minute, over that partial hour? If so, would it be minute by minute or second by second?

When AWS terminates an instance due to price, do we pay for that partial hour?

Previously there was no charge for this at all, and this was a documented but not-widely-known characteristic that opened up for some interesting optimization strategies of purposely bidding some instances based upon price history, volatility, and future predicted price to increase the odds that some would be lost between 30-45 minutes into the hour, but not so many that would trigger an under-provisioned state. We had employed this strategy for some of our clients and in some cases generated some significant additional savings over normal Spot savings. We wanted to see if those strategies still had relevance in the per-second Spot world, and adjust accordingly.


This post is a summary of what we have learned trying to answer these questions based upon numerous conversations with clients, AWS contacts, and analysis of detailed billing logs of tests we have run this week.

Which price is used to calculate the pro-rated per second price?

The answer to this one appears to be that it will remain the same as in the hourly billing case. The price used for calculating the partial hour is the price at the beginning of that hour, ignoring any fluctuations in price over the partial hour. If you bid $0.30 on a Spot instance that was priced at $0.10 at launch time, and one minute later the price went to $0.25 and stayed there, and you terminated it after 30 minutes, you would only pay $0.05 (half an hour at $0.10). This opens up some new and interesting optimization strategies since for a significant period of time an instance is being charged per second at either over or under the current Spot market value. Even though the price in this Spot market has risen considerably, my “locked in” price might still be cheaper than other available markets, and I might make the decision to let it continue to run there at least until the next hour mark comes up and the price would get updated. Or in the flipside case, where the price has dropped considerably from what I am paying. It might be cost-effective to start a new instance at the lower price and terminate the current one. We are still analyzing and testing variations on this strategy, if it proves effective we will make another blog post on the topic in the future.

When AWS terminates an instance due to price, do we pay for that partial hour?

The answer to this one has a surprising twist we did not expect. The twist is: it depends on which hour you are in. For the first hour, it appears to be exactly as before, you pay nothing and essentially receive free compute for however long the instance was running before it was taken away. For the second or subsequent hour, you will be charged for the pro-rated hour, identically to how you would be charged if you had terminated the instance yourself. So the free-compute bidding strategy loophole appears to have been made considerably smaller, but not closed completely.


To reiterate, this is only the summation of our testing and unofficial conversations with multiple parties to date.

Until AWS updates the public facing documentation or makes a public statement on the topic, we will not know for sure. They may also still be in the process of finishing all the per second changes as it relates to Spot, and the behavior we have been seeing this week could change. Time will tell.

If anyone has noticed something different in your own AWS account, or knows something different than what we have concluded here, please comment your findings, or if you are seeing the same type of behavior, let us know that too. As we learn more, we will update this post, so check back.


  1. Nice post. I just stumbled upon your blog and wanted to say that I have truly enjoyed surfing around your blog posts.
    In any case, I will be subscribing to your feed and I hope you write again soon!

  2. Hi, and thanks for this blog post. I’ve recently been researching this specific topic, and this helps a lot. Thanks.

Leave a reply

Your email address will not be published. Required fields are marked *