What Constitutes a Compute Hour or Cost/Hour

18,663

Solution 1

An hour counts as the time your app is deployed (running or not, being accessed or not). An hour is a 'wall clock' hour - meaning if you deploy at 10:45am and deleted at 11:05am, you are charged two hours (the 10 o'clock hour and the 11 o'clock hour).

Solution 2

Good answers by David and Mike. Let me add a bit: Rather than thinking in terms of apps, think about virtual machines. When that virtual machine is spun up (even in a stopped state, the virtual machine is allocated), you're being charged. You can easily start and stop apps within that virtual machine instance: Maybe it's a web application, background rendering process, whatever. Whether you're burning 0% CPU or 100% CPU, you're paying in clock-hours for that virtual machine.

Note that even with Cloud Services (web and worker roles), you're ultimately dealing with virtual machines. Each instance of a web role or worker role is its own Windows Server virtual machine.

Oh, and same goes for Web Sites reserved instances.

Regarding your question of switching an application off to save billable hours: If, say, you have a nightly process that runs for maybe an hour or two, then consider placing that process in its own Cloud Service (or Virtual Machine). When the time comes to run it, deploy it to its named slot (yourname.cloudapp.net), let it run until the task is done, then delete the deployment. Now the virtual machine instances hosting your process runs for 2 hours, not 24. What you can not do is reduce the count of a web or worker role to zero. So if you have, say, a web role with 2 instances and a worker role to do some nightly stuff, you cannot set the count to zero worker role instances upon completion of the task. That's why I suggested placing the nightly task in its own deployment.

EDIT Things have changed a bit since over the past few months. In particular, the following was announced in June 2013:

  • Billing is now per-minute instead of per-hour. This applies to Virtual Machines, Cloud Services (web/worker), Web Sites, and Mobile Services.
  • You may now stop Virtual Machines without deleting them, and billing stops while the VM is stopped. Note: If no other Virtual Machines are running in the same deployment, you'll lose your assigned IP address. To prevent IP-loss, you would need to stop the Virtual Machine but leave it in a provisioned state, which means you'd still be billed for the stopped VM but you'd preserve your IP address. Again, this caveat only applies to scenarios where there's no other Virtual Machines running.

You can read ScottGu's blog post about the per-minute and stopped-VM updates here.

Solution 3

To be more clear, the time your app is deployed means the time the server/s instance/s that host your app is active. Effectively the time is measured in clock hours.

[Edited] A "stopped" VM on Azure Virtual Machines (IaaS model) no longer consumes compute hours, you will only be billed by the storage/managed disks until you decide to delete the VM.

Share:
18,663

Related videos on Youtube

culturalanomoly
Author by

culturalanomoly

Updated on June 15, 2022

Comments

  • culturalanomoly
    culturalanomoly almost 2 years

    Preface

    I've been shopping around for cloud based hosting solutions, particularly MS Azure & Amazon's EC2. They, Microsoft and Amazon, have pricing tables which describe a "cost/hour"/"compute hour."

    Question

    When they say "cost/hour" or "compute hour," what's in an hour? Is it the amount of time an application pool, in the case of an ASP.NET app, is active? Or, the amount of time that your application is active? Or, is it related in some manner to the incoming requests per hour/minute?

    Is there a possibility that if the app is not active (serving requests) it's not factored into the overall cost calculation, thus reducing the overall "compute time"?

    • Keith Nicholas
      Keith Nicholas about 11 years
      this is off topic, but you are paying for a virtual machine, so however long thats running, and however much CPU it uses
    • culturalanomoly
      culturalanomoly about 11 years
      @KeithNicholas isn't "however much CPU it uses" counter intuitive? just by the fact that the virtual machine is running, compute hours are being used ... or, am i wrong?!
    • Keith Nicholas
      Keith Nicholas about 11 years
      its only for plans that you are effectively buying computing grunt, if the CPU is is idle, you aren't paying for it, if you kick off a calculation that gets 8 processors using 100%, then you are paying more
  • culturalanomoly
    culturalanomoly about 11 years
    ok, makes sense. must be a much simpler metric to calculate on the provider's side. is it possible, in the case of Windows Azure, to "switch an application on/off" to save billable hours?
  • culturalanomoly
    culturalanomoly about 11 years
    +1 your answer, explanation and real world tip for working with cloud providers was just what i needed to know. thanks!
  • culturalanomoly
    culturalanomoly about 11 years
    +1 thanks for the answer and distinction that a stopped instance doesn't prevent you from being charged compute hours ...
  • Co7e
    Co7e over 10 years
    A stopped VM is no longer billed
  • Co7e
    Co7e over 10 years
    @Curiosity it is for VMs, since June 2013, but not for cloud services. The cloud service deployment must be deleted to save billable hours.
  • cutts
    cutts about 10 years
    There's an erroneous period at the end of the URL causing the 404. I'd edit the post but don't have sufficient reputation to make a single character edit.