AWS EC2 spot instance billing - amazon-web-services

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

Related

AWS Free Tier Alert

So I'm receiving this alert at the end of every month for the past year.
And rightly so in my cost & Bills Dashboard there it is:
But each month I go in RDS Dashboard and it is empty, I checked every tab and didn't found anything.
Could that be a glitch ?
Thanks a lot
This is because AWS count this if how long your AWS instance is running other than other factors.
For RDS the maximum amount of time an instance can run is 750 hours which usually cover a complete month of 31 days.
Normally you use *30 = 720 (744 in the case of 31 days) hours so AWS wore you if your free tier is about to exceed.
if you calculate then it would be about the % showing by the console.

What counts as "usage" in Redshift?

Say I just issue a daily copy command, as opposed to streaming all my data immediately into redshift. Does that mean I have a really low percent usage, and therefore I have a low bill?
According to the Amazon simple monthly calculator, using 10 ds1.xlarge on-demand nodes will run me $6,844.20 a month.
However, if I only use those nodes for one hour a day, it will only run me $263.50 a month.
To be more specific, there are two strategies I'm considering. One is to send my data (which comes in at a rate of hundreds a second) to a Firehose stream, which is pointed at a Redshift cluster (with an intermediate S3 bucket of course). The other strategy is to send my data to a different Firehose stream, which is pointed at an S3 bucket; then, I issue a daily COPY command (through JDBC). Let's assume that I read very rarely from my database, such that the total amount of time spent COPYing and reading in my database does not exceed one hour per day.
You pay for Redshift by the server hour, just like EC2, RDS and ElastiCache. You are reserving a specific amount of server resources and you pay for that each hour that it exists, regardless of actual "usage".
The "Usage" field in the calculator defaults to "100% Utilized/Month" which would result in the price of a Redshift cluster that existed for the entire month. By changing it to "1 Hours/Day" you have indicated to the price calculator that you plan to create a Redshift cluster once a day, and delete it before it has existed for more than an hour, and then do that again the next day, every day of the month.
The amount of time you spend copying/updating/reading from your Redshift cluster has no bearing on the monthly price of the cluster.

will I be charged by aws s3, if I create a post then delete it through admin?

I'm using django and elastic beanstalk. I just made a new post and saw I was charged 0.01$ from aws which kinda worries me. Does this mean every time I make a post this amount will be charged? what if I make one then delete it, will I still be charged? can someone with an experience of elastic beanstalk help me out?
Why not delete it and see what happens to the cost? Deleting doesn't account for data transfer thus my guess is you won't pay a thing. Putting items on the queue does account for data transfer and you will pay. Keeping items on the queue (data storage) will cost you as you can see here: https://aws.amazon.com/elasticbeanstalk/pricing/
Amazon EC2 Pricing (includes pricing for instances, load balancing, elastic block storage, and data transfer)
Amazon S3 Pricing (includes pricing for storage and data transfer)
The actual issue here seems to be a misunderstanding of the terminology used in pricing.
S3 charges $0.005 per 1,000 PUT/POST/LIST requests (some regions are somewhat higher, but this pricing is used through the rest of the answer).
This terminology does not mean that each request will actually be billed as $0.005 รท 1000 = $0.000005, even though this is a close approximation of what they will ultimately cost.
It actually means you are billed CEIL(TOTAL_REQUESTS / 1000) * $0.005...
...where TOTAL_REQUESTS is the number of that type of request you made during a monthly billing interval within one S3 region.
So making 1, 2, 500, 999, or 1000 requests is still a total monthly usage of $0.005, rounded up to $0.01. Not $0.01 each.
Making 1001 through 2000 total requests is a total of $0.005 + $0.005 = $0.01.
Making 2001 through 3000 total requests is a total of $0.015, which rounds up to $0.02.
...ad infinitum...
You wouldn't billed more than $0.01 total until after the first 2000 requests.

AWS Spot Instances : At what price am i billed?

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.

Amazon EBS pricing: monthly? daily? hourly?

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.