Is there a Minimum Uptime for Elastic Bamboo Instances?
Asked by Matthew Hillier:

We have setup our Jira Studio with Elastic Bamboo, and have eveything working, however now that it has settled in, we have noticed that instances are always up a minimum of 50-55 minutes. The automatic shutdown, which is specified as 3 minutes after end of job for Elastic Agents and 120 seconds for the Elastic Instance, doesn't seem to be applied to the instances until after this 50 minute "minimum uptime".

Is there a setting I am missing or is this a default that we cannot change?


Answers:
author: Przemek Bruski
body: There's no setting.

With elastic instances, you pay the same amount for every started hour, so it makes no sense to prematurely terminate an instance - it may still become useful and is already paid for the whole hour anyway.

comments: author: Przemek Bruski
body: Yes, you are charged for every started hour: if the instance runs 1h1m it still counts as 2 hours.

The only exception to this rule are spot instances terminated by Amazon - then you pay only for the full hours of uptime.


author: Matthew Hillier
body: Ah, that makes sense. So, just for clarification, I'm assuming that instances are charged by elapsed-hour and not clock-hours?


author: Matthew Hillier
body: Got it! Many thanks :)


author: hughperkins
body: That's not how EC2 works. You get billed on a per-hourly basis, for the maximum number of simulltaneous instances running during that hour. Therefore, if you shut down an instance, and start a new instance, within the space of one hour, you only get billed for one hour-instance.

I would like to be able to get my linux instance to shut down when idle, so that the Windows instance can come online and do the windows build, but currently this isn't possible.


author: Przemek Bruski
body: > Therefore, if you shut down an instance, and start a new instance, within the space of one hour, you only get billed for one hour-instance.

Could you point me to Amazon docs that confirm this? I know this:

"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."

Which would mean that you would pay for two instances.


author: hughperkins
body: I tested it a long time ago, and I've used EC2 for a while. You can start and stop arbitrary instances as many times as you like within each billable hour. As long as none of the instances overlap in time, you will get billed for a single cpu-hour.


author: hughperkins
body: Hmmm, you know, I've tried to reproduce my results again, but the results are inconclusive, or possibly support the idea that you are billed for each instance started, not for maximum simultaneous instances. It's not obvious to me how to read the UsageReport that you can get from <https://portal.aws.amazon.com/gp/aws/developer/account/usage-report.html>


author: hughperkins
body: Hmmm, I retested, by watching the number of hours billed on the 'account activity' page. Seems either I tested wrongly before, or it's changed, but seems your interpretation of billing looks to be correct. I ran two micro instances, one after the other, this morning at 7am, and now my billing has been increased by 2 hours, not the 1 hour I would have predicted. Edit: and the 'usage report' also confirms 2 usage units of micro at the corresponding time. So, it's pretty certain that your interpretation of the billing is correct, and mine has been wrong for, well, years :-D


author: hughperkins
body: Nevertheless, even taking into account the correction of my interpretation of the EC2 billing, there is a use-case for early instance termination. If one has only a single Bamboo license - for example, for an opensource project - and one wants to do builds on multiple platforms, eg linux-32, linux-64, windows-32, and windows-64, if one is willing to pay for the EC2 hours (which I guess I am), then one could accelerate the build by anything up to about 3.5 hours by shutting down each instance after each part of the build.


author: Przemek Bruski
body: Yeah, I agree. I've opened a ticket for this: <https://jira.atlassian.com/browse/BAM-13482> .


author: Hugh Perkins
body: Cool. Thanks!


author: hughperkins
body: That's not how EC2 works. You get billed on a per-hourly basis, for the maximum number of simulltaneous instances running during that hour. Therefore, if you shut down an instance, and start a new instance, within the space of one hour, you only get billed for one hour-instance.

I would like to be able to get my linux instance to shut down when idle, so that the Windows instance can come online and do the windows build, but currently this isn't possible.


Tags: cloud

jira-studio