I have a small question on the spot pricing. Let us assume I have placed a max bid of $0.15 for a c3.large spot EC2 instance. And the current price at that time time was $0.08per hour.
Eventually in the next hour the spot price dropped to $0.03 per hour. Now my question is at what price will I be charged?
$0.08 for the first hour and $0.03 for the second hour?
$0.08 for my entire usage?
Per the documentation for Spot Instances:
Spot instance-hours are billed based on the Spot price at the start of
each instance-hour. If your Spot Instance is interrupted in the middle
of an instance-hour (because the Spot price exceeded your max bid
price), you are not billed for that partial hour of Spot use.
(However, if you terminate the Spot instance, you are charged for the
partial hour of use.)
The important part there is that spot instance-hours are billed based on the Spot price at the start of each instance-hour.
So if the price dropped to $0.03 during the second hour, but not at the time that the second instance-hour began, then you would be charged $0.08 for the second hour. You would be charged $0.03 for the third hour, assuming the price does not change again.
Related
I have created an EC2 spot instance, using automated bidding and an EC2 instance was created within a few minutes and I terminated the same after a few minutes.
How do I know how much I would be billed for the spot instance I ran? I browsed the 'Instances' and the 'Spot Requests' tab for the same, but could not get the same.
You want to use the Spot Instance Data Feed:
To help you understand the charges for your Spot Instances, Amazon EC2 provides a data feed that describes your Spot Instance usage and pricing. This data feed is sent to an Amazon S3 bucket that you specify when you subscribe to the data feed.
Data feed files arrive in your bucket typically once an hour, and each hour of usage is typically covered in a single data file. These files are compressed (gzip) before they are delivered to your bucket. Amazon EC2 can write multiple files for a given hour of usage where files are very large (for example, when file contents for the hour exceed 50 MB before compression).
By the way, with the new per-second billing for EC2 instances, Linux spot instances will also be billed per-second.
You always pay the current spot price. If you bid 0.20$ and the current spot price is 0.15$ then you pay 0.15$ for that one hour. As soon as the next hours starts, you pay, whathever the new spot price is at that moment your second hours starts.
You always pay the full hour even though you shut down your instance before the end of that one hour. The only exception from that, is when your spot instance gets terminated because the spot price exceed your bid price. Then the last hour is not charged. Example: If the spot price exceeds your bid 15 minutes after the second hour has begun, than you only have to pay the first hour. If the spot price exceeds your bid 59 minutes after the second hour has begun, than you still only pay the first hour.
Also refer to this page:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html
They say there is always a monthly fee. But does it get charged as the month progresses or right away?
Amazon WorkSpaces is charged on a pro-rata basis.
So, if you run one for one week and turn it off, you'll be charged approximately one quarter of the monthly fee.
The first month's fee and the last month's fee are similarly pro-rated, based upon how long the WorkSpace was running.
There is no charge for creating a WorkSpace.
I would like to create an auto scaling group [ASG] with spot instances as a supplement to my production ASG that has on-demand instances.
After reading this post , I would like to mimic it but maybe without the dynamic bidding and auto-scaling at first.
So, I was wondering , if I just set the bid price for the spot instances equal to the on-demand price of the instance I use [m3.large] , would I be paying the lowest bid price [for that instance, in the region, in that hour] ??
So if the spot price is $0.01 and my max bid in the ASG is $0.067 , I would be paying $0.01 for every spot instance the ASG launches, right??
[That is what I understood from the AWS docs but I would like a confirmation]
And finally, by this kind of thinking [that I suppose I am not the only one to have] do I drive the spot instance prices up ?
Spot instance prices are different among Availability Zones. You pay based on the market price (M) where your instances are in.
You set a bid price (B). The payment rule is:
If the market price is lower than or equal your bid (M <= B) and there are free resources on spot-instances pool, you pay the market price.
If the market price is higher than your bid (M > B, outbid) or there are no free resources on spot-instances pool, your spot-instances will be terminated and no need to pay the current partial hour. You only need to pay the full hours that you used.
If you run spot-instances less than an hour and you terminate it by yourself, you need to pay for that partial hour.
Your bid is only the maximum amount that you want to pay for the spot-instances.
For more detail, you can see the official documentation. The market prices are driven by availability free resources and market demand.
For a bidding strategy, you can consult Spot Bid Advisor. In that page, you can find which instance types has lower outbid frequency based on the bid.
Added as per #Michael's suggestion on comment below:
The current market price is the lowest bid among all currently running instances. As an illustration, let say there were 3 instances were available (maybe more in the real case), and there were 4 bids for $1, $2, $3, and $5, the three highest bidders would have running instances, and the market price would be $2. So, your bid price may drive the spot instance indirectly if you are a winning bidder and there are more open bids than available spot instances.
What is the maximum bid price for an AWS EC2 spot instance of a given instance type (Eg:m2.xlarge, m3.medium etc) ? Where can I find that out?
In case this is why you are asking - there is no bid amount that you can enter that will guarantee your spot instance will remain running - even if you are the highest bidder.
EDIT: Thru trial a bit of trial an error after #Michaels comment below, I have determined that there is indeed a limit. I tried to launch 1/2 dozen instances of various sizes and bid $100/hr for each. At each failed attempt I was told that the maximum price was exceeded and was quoted a max price that was 10X the ondemand price. So if the instance on-demand price was 0.14, I was given the error that my bid exceed the max of $1.40.
I also could not find documentation of this anywhere, but a bit of trial and error seemed pretty indicative that 10x is the limit.
The maximum price you can bid is 10 times the on-demand instance price of that type.
The AWS documentation has a section about Spot bid limit. Currently, it is capped to 10 times the On-Demand price:
The bid price limit for Spot instances is ten times the On-Demand price. This limit is designed to help you control costs.
With Amazon Elastic Block Store, you only pay for what you use. Volume storage is charged by the amount you allocate until you release it, and is priced at a rate of $0.10 per allocated GB per month.
This is priced per month. Other things are priced per hour (and that means that if you use something for two minutes, you still pay an hour).
So what if I allocate 10 GB at 8 AM every day, and deallocate it at 10 PM, so that at no time I am using more than 10 GB. Will I be charged for 10 GB or for 30 times 10 GB?
What if I allocate 100 GB, but only for one day? Will that be the same cost as having the 100 GB for the whole month, or just 1/30th of that?
I have been reading the FAQ and other docs for a while, but could not figure it out.
What if I allocate 100 GB, but only for one day? Will that be the same cost as having the 100 GB for the whole month, or just 1/30th of that?
I've read the FAQ too but let me tell you that if Amazon charged me the $0.10 with a monthly rate I'd be broke by now. I spin up (and spin down) ebs-backed servers several times (30-40) a day and still receive a bill that is not much more than a few dollars.
My guess is that they charge you hourly and this question on serverfault seems to confirm that experience
EBS pricing page at https://aws.amazon.com/ebs/pricing/ makes this clear:
Volume storage for General Purpose SSD (gp2) volumes is charged by the amount you provision in GB per month, prorated to the hour, until you release the storage.
And same for other volume types. So basically the pricing is hourly, just that they put the number in months as it'd be too small to have a reasonable judgement if they put it per hour.
update.
AWS now does per second billing for EC2 and EBS and a few other things too
See this announcement for an overview
https://aws.amazon.com/blogs/aws/new-per-second-billing-for-ec2-instances-and-ebs-volumes/
According to this form page they charge by the day:
https://forums.aws.amazon.com/thread.jspa?messageID=250288
See this section:
Sorry, maybe my answer was not clear enough. Let me put it in another
way: No, you will not be charged for the full month. One day only in
that case. That's how "gigabyte months" works.