If I have 2 equal EC2 instances running simultaneously for 12 h a day and I have only 1 reserved instance, does this reserved instance cover the cost of both instances since the sum of daily hours is 24h? Or however, since the 2 works simultaneously, would not the reserved one cover me and would they apply extra expenses? Thanks in advance.
According to this document from rackspace, you would be billed for 1 reserved instance, and 1 on-demand instance when it is running:
Example 4: Oversubscribing your Reserved Instances for half the time:
Assume that you have purchased 2 Reserved Instances. You decide to
launch 4 instances for only 12 hours per day, and Terminate or Stop
them for the other 12 hours. In this scenario, you will be charged an
additional 24 hours (12 hours x 2 instances) at the On-Demand rate, as
you already have 2 instances consuming your Reserved Instance
reservations and any additional instances running at the same time are
charged at the On-Demand rate. You cannot store unused Reserved
Instance hours and use them to oversubscribe at other times. If you
have workloads that need predictable scaled capacity, you may consider
want to consider a purchase of Scheduled Reserved instances instead:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html
from: https://manage.rackspace.com/aws/docs/product-guide/reserved_instances.html
Related
Our organization has many EC2 on-demand instances. We never looked at the reserved instance pricing because we thought we had to pay up-front. But I see that now there are reserved instance with no up-front costs, but monthly.
This looks like what we need to keep costs down, but I am unclear as to how the reserved instance pricing is applied.
For example, we have 10 t3.medium ec2 instance. Let's say that there are 6 always running 24/7, but the other 4 are not running 24/7, they are turned off when not in use.
If I buy a reserved instance for t3.medium, how does AWS know to apply it to the instances running 24/7 and not part time?
For example, we have 10 t3.medium ec2 instance. Let's say that there
are 6 always running 24/7, but the other 4 are not running 24/7, they
are turned off when not in use.
If I buy a reserved instance for t3.medium, how does AWS know to apply
it to the instances running 24/7 and not part time?
Amazon doesn't apply reserved pricing to a specific instance at all. It basically just applies reserved pricing to your bill. It's like a discount at the time your bill is processed. If you have reserved pricing for N instances, and you have at least N instances running 24/7 reflected in your bill, then the reserved pricing gets applied to those N instances.
Amazon doesn't really care if you are running a single specific instance 24/7, or deleting and recreating instances once a minute. In the end it's just the total number of seconds you have a specific type of instance running each month that they care about, and bill you for.
Be aware that when you setup instance reservations it is actually a capacity reservation. You are telling Amazon you are committing to running this type of instance 24/7 for either 1 year or 3 years. By letting Amazon know this, it helps with their capacity planning, and in return they give you a cost discount. But it also means that they are going to charge you for that reserved capacity even if you don't actually have that instance running 24/7.
I have a fresh AWS account with Reserved Capacity of 15 EC2 instances of the same instance type in the same region primarily intended for EMR.
If I spawn a EMR cluster with 10 instances for 15 days and scale it up to 20 instances for the remaining 15 days, will I get charged $0?
If not, how will the final bill for EC2 for the month be calculated?
The reason why I am confused is that based on my understanding EC2 charges based on capacity consumed (in instance hours) and not on actual instances allocated. Since I'm reserving 15 instances worth of capacity, I would expect it to cost me a total of $0 since my overall monthly average consumption is worth 15 instances.
The Reserved EC2 Pricing documentation and most of the AWS price-calculation related material on the internet don't mention the use-case of dynamic scaling of instances in accounts with reserved capacity.
Reserved instances are applied to running instances in real time, not averaged over any longer period of time. They are baseline, not average.
For example, if you own three Reserved Instances with the same instance attributes and region (or Availability Zone if applicable), the billing system checks each hour to see how many total instances you have running that match those parameters. If it is three or less, you will be charged the Reserved Instance rate for each matching instance running that hour. If more than three are running, you will be charged the On-Demand rate for the additional instances.
https://aws.amazon.com/ec2/pricing/reserved-instances/buyer/
At any instant in time when you lack enough reserved capacity to cover your running workload, you're billed for the excess.
To Developers,
Can an AWS Batch job use Reserved Instances?
I would end up using a base of RI's + (On-Demand or Spot Instances) per Client.
I would like the cost savings from Reserved Instances but need more reliability than spot.
Thanks,
Marc
Yes, Batch compute resources are just ec2 instances - and reserved instances are just a billing mechanism, and are not assigned to a particular instance - i.e. you don't tell AWS which EC2 instance in particular is a RI and which is an OnDemand - it doesn't matter.
So if you have 20 RI, and need 40 running during the month, so you fill the gap with 20 on-demand or spot instances, then 20 will be billed as RI and 20 will be OD/or spot. If you kill any 25 instances (for example), you will still be billed for 20 RI in this example and no spot or OD instances.
My guess is that maximizing the use of spot instances is going to save you some money - but it is sound logic to have a certain number of RI around to provide a base level of service - and you can't count on there being ANY spot or ANY OD instances at any given time.
I want to programmatically launch and shutdown instances via API.
I know little about AWS , how is kind of action will be charged ?
if one instance costs for 10 dollar for one hour.
And I launch and shutdown it back and forth 10 times in 1 hour.
How will it be charged ?
From Stop and Start Your Instance
Each time you start a stopped instance we charge a full instance hour, even if you make this transition multiple times within a single hour.
So in your example, you'll be charged $10 * 10 = $100
The correct terminology is start and stop the same instance. When you launch, you create a new instance, still the charge remains $100.
If you launch and shutdown a single instance 10 times in one hour, you will be charged for 10 hours worth of time.
Amazon charges by the hour, rounded up to the nearest hour, by instance. Partial hours don't get combined with other partial hours.
You defintely don't want to start and stop instances over and over again if you can avoid it.
I'm in the need of AWS instances but only for short periods of time, for example 1 minute every 20 minutes. This means, launching an instance, doing some work for a couple minutes and then shutting down for 20 minutes.
Does AWS apply extra fees or limit accounts that follow this behavior?
Quote from AWS page : Pricing is per instance-hour consumed for each instance, from the time an instance is launched until it is terminated. Each partial instance-hour consumed will be billed as a full hour.
Does this mean that each 2 minute session will be billed as a full hour? I'm guessing no, but I can't be sure.
Every time you run or start an instance you are charged for at least one hour of run time (more if you leave it running past 60 minutes, obviously).
You will be charged three times as much for starting and stopping an instance three times an hour instead of just leaving an instance running full time.
Here's an experiment I ran in 2010 demonstrating this billing quirk:
EBS Boot Instance Stop+Start Begins a New Hour of Charges on EC2