Misunderstanding in billing of Reserved instance - amazon-ec2

I launched a m3.medium reserved instance yesterday, but the usage is already 163hrs and charge me 5 dollars, what does it mean by the usage of that amount of hours?
ps: I launched one on-demand instance before, but I just ran it for 2 hours and stopped it. After purchasing the reserved instance, I restarted it.

You can see amazon's billing documentation for an explanation of this pricing.
http://aws.amazon.com/ec2/purchasing-options/reserved-instances/
Light and Medium Utilization Reserved Instances also are billed by the instance-hour for the time that instances are in a running state; if you do not run the instance in an hour, there is zero usage charge. Partial instance-hours consumed are billed as full hours. Heavy Utilization Reserved Instances are billed for every hour during the entire Reserved Instance term (which means you’re charged the hourly fee regardless of whether any usage has occurred during an hour).

Related

AWS EC2 instance reboot loses all CPU credits

Recently I was required to reboot my EC2 instance due to an AWS maintenance alert. After reboot I noticed my CPU credit balance was consumed. Why is that? What's going on?
Stopping and Starting a t2-standard class instance moves your instance to a new host system, clears your credit balance and then ordinarily¹ gives you a baseline of 30 credits per vCPU to ensure a smooth start-up.
T2 Standard instances get 30 launch credits per vCPU at launch or start. For example, a t2.micro has one vCPU and gets 30 launch credits, while a t2.xlarge has four vCPUs and gets 120 launch credits.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-std.html
Rebooting doesn't do this, but restarting (that is, a stop followed by a start) does, and the stop/start required for most maintenance events is a restart, not a reboot.
Tip
To ensure that your workloads always get the performance they need, switch to T2 Unlimited or consider using a larger T2 instance size.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-std.html
T2 unlimited machines are allowed to borrow against future CPU credit earnings for the upcoming 24 hours, so they don't receive the initial credit balance. You aren't charged extra for these borrowed credits, unless your workload is so heavy that over the subsequent 24 hour period is you continue to use credits at a rate that causes you to spend more than you could have earned.
¹ordinarily unless you have performed more than 100 stop/starts or launches of more than 100 t2-standard machines in the past 24 hours or your account is new, to prevent gaming the system. New accounts gradually ramp up to the 100 threshold.

Amazon EC2 : High resources usage although I have no running instances

At the end of last month, I started experimenting with Amazon EC2. I launched one or two t2 micro instances, to experiment for free under the free tier.
However, I have quickly noticed on my billing dashboard that my services usage was increasing fast, and after a few dayswas forecast to exceed the free tier limitations by the end of the month. Since I don't need to maintain an 24/7 online presence at the moment and mostly use my instances to experiment, I have terminated one and stopped another. I have even detached the volume of the stopped instance.
All I have left are:
One stopped micro instance
One detached volume
Two snapshots of that volume
One AMI that I had used to move my instance from one region to another in the beginning
As far as I understand it, those more or less "idle" resources, at least not highly active ones. And yet, in my billing dashboard, in the row EC2 - Linux, the month-to-date usage keeps increasing, at the rate of more than one hour of usage per real-time hour.
Before I detached the volume, the usage would increase by 14 hours in only 3 hours. Now that I have detached it, it slowed down a bit, but still increased by 16 hours in the last 13 hours. All that, again, without actively running anything!
I am aware that the tally of the usage isn't strictly limited to running instances, but to associated resources as well. But still, it seems very high to me. I don't even dare to test my app anymore.
I would like to know if such an increase is normal, or if there may be something wrong with my account and how I configured my instances. If it is normal, any indications as to what actions I could take to reduce this increase would be very welcome!
Note that I did contact the Amazon support several days ago and didn't get a single reply, this is why I'm turning to here.
Thanks in advance!
Edit: Solved. I did have an instance running in another region, probably by mistake because I had never interacted directly with that region. See comments for a script to systematically check all regions and avoid this kind of stupid mistake.

How exactly does AWS EC2 count hourly costs?

Simple question:
If I had six identical EC2 instances process data for exactly ten minutes and turn off would I be charged six hours or one hour?
Update: EC2 and EBS are now based on usage down to the second
Old answer
Granularity for changes are measure down to the hour.
From the AWS pricing site http://aws.amazon.com/ec2/pricing/:
Pricing is per instance-hour consumed for each instance, from the time
an instance is launched until it is terminated or stopped. Each
partial instance-hour consumed will be billed as a full hour.
Unless you are calculating time to be under a threshold for a free tier, the second you use an EC2 instance you're charged for the full hour. If you go one second over the first hour, your charged for a full second hour.
One caveat: Spot Instances.
If spot instances are interrupted by AWS (not you) before reaching a full hour use, you're not charged at all. If you interrupt the spot instance, you're charge for the partial hour usage (which is a full hour rounded up as per the on-demand instances).
AWS has introduced per second billing for EC2/EBS effective October 2, 2017.
New EC2 Billing
You always get 750 hours per month for all your ec2 instances.
Different cases:
Case 1: Your have created and running one instance for 10 minutes.And then stopped.
It will be counted as 1 hour.
Case 2: Your have two running instances for each for 5 or 10 minutes and then stopped. It will be counted as 2 hours.
Case 3: You have one instance running for 10 minutes, then stopped and then again started for 10 or 5 minutes. It will be counted as 2 hours.
You can only use t2.micro servers and some limited OS in free tier.
This way, you can prevent your unwanted billing.
I hope, this has cleared some doubts.
Note: This is just my understanding till today. Please check their(aws) pricing docs for updated information.

What's the minimum time counted for billing in Heroku?

Ec2 instance hour calculated by hour by hour. If you just start and close an instance, it still counted as one hour.
How Heroku handle this? By Minute or By Hour?
Lets assume my app usage exceeds 750 Free Dyno Hour Limit
Heroku prorata to the second. A dyno costs $0.05 per hour. So if you go over 750 hours you will be charged at $0.05 per hour or $0.000833333 per minute. In fact, pretty much all addons also follow the same billing model too.
You can read about billing and charges as https://devcenter.heroku.com/articles/usage-and-billing#cost
I will say, though, that the previous answer seems to be more accurate for the web dyno versus a worker dyno. Heroku's automated sleep cycle for your web dyno tries to prevent it from running too long when it's idle, say, for more than an hour. For the free web dyno it must sleep at least six hours per day for it not to incur charges. As long as you set the scaling to 1 for your web dyno and it sleeps then it should be free.
That said, when you add your first worker dyno those same automations aren't applied to this dyno. It presumably won't be triggered to sleep on idling for an hour. This means that unless you manage it you'll likely be charged $34.50 for each worker dyno per month. I wouldn't exactly call this lying to the customer but most people start off with that first free dyno, get comfortable with that and then innocently think that the next dyno will behave in a similar way--it won't and you'll likely get tagged paying more money than you'd bargained for. That's $414-per-year for a dyno. Compare this with Amazon's t2.micro cost of $150-per-year for one instance or $75-per-year for a 50% duty cycle of same.
As they say, "the devil is in the details". Heroku might be cheap for vanity websites but it's a bit costly if you have a database and worker thread (without any scaling otherwise whatsoever).

Do Reserved Instances in AWS EC2 Have Better Performance Than On-Demand or Spot Instances?

I'm considering purchasing an Amazon AWS EC2 reserved instance. Does any one know of any performance benefits for reserved vs. on-demand, spot instances? Or is this simply a pricing difference? Do reserved instances get spun up on VMs with less congestion and that sort of thing is what I'm thinking about.
Thanks,
Michael
Despite its name, "reserved instance" is a billing construct, not an instance type. When you purchase a reserved instance, no instance is started. It simply affects the price you pay for a standard on-demand instance that matches the availability zone, instance type, operating system of the reserved instance purchase.
Purchasing a reserved instance can reduce the hourly price you pay for an on-demand instance that has already been running for months. If you terminate that on-demand instance, the reserved instance pricing switches to any other on-demand instance that is running and matches the specs.
Spot instances are the same as on-demand instances except in when they are started/terminated and how much they cost.
Spot instances are basically when amazon has unused resources they can sell them at a slightly lower price to hopefully get those used up. The issue with spot instances is that they can be shut off at any time so you're taking a risk.
Reserved instances are computing power you can purchase upfront at a discounted rate. You're basically saying that you're going to use this type of system for 1 or 3 years or if you're not going to use it you want to ensure that you can use it at any time.
On-demand is the default for most people, I think. They're there. They're available when you need them and when you don't need them you stop paying for them.
If you purchase the same types of machine configs for each type of instance then there is no performance difference, only price.
The Amazon page on reserved instances doesn't mention any other benefits apart from the cost.
Adding to what #BuildStarted said, I have noticed longer start times with spot instances. I'm guessing that's because there is some additional time needed to compute the current spot price and find capacity.
Once an instance is up and running, though, you shouldn't see any difference between the 3 pricing methods for the same instance type.

Resources