睡眠时,Azure Worker角色是否需要向$$收取费用? [英] Does Azure Worker Roles get charged $$ when they are Sleeping?

查看:70
本文介绍了睡眠时,Azure Worker角色是否需要向$$收取费用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何(大致)计算出我正在考虑创建的某些角色的预期成本.

TLDR;

如果您的员工Sleep(someTime)/正在睡觉,天青会向您收取费用吗?


详细信息

"Azure定价"页面列出了每个定价小时和每个VM大小.

为使问题简单,假装我想拥有3个工作人员,每个工作人员都将在Small(A1)实例上.

现在-踢手是这=>时间!

所以也要假装,这正是每个工人所做的.

Worker 1 : Do-Some-Work-That-Takes-1-Second-Exactly. Sleep(59000);

Worker 2: Do-Some-Work-That-Takes-5-Seconds-Exactly. Sleep(550000);

Worker 3: Do-Some-Work-That-Takes-10-Seconds-Exactly. Sleep(50000);

因此,工人1工作1秒钟,然后睡眠59秒钟.工作人员2:5秒+ 55秒睡眠.工人3:10秒+ 50秒睡眠.

这个想法是,工人每分钟都会开始"做他们的工作.

**是的,我知道实时工作是可变的..但是让我们保持简单**

那么,对于每个工人,他们是按分钟(工作+睡眠)还是仅按工作时间收费?

例如. 1秒+ 5秒+ 10秒=每分钟16秒. = 16 * 60 =每小时960秒的工作时间

如果一个小时中有3600秒..这意味着在我收取1个小时的工作"费用之前,这还不到4个小时或真实的生活时间?

解决方案

工作人员和Web角色是按部署的每小时收费的,因此即使不执行任何操作也要收费,因为您已经物理地调试了要启动的虚拟机./p>

即使角色已停止但尚未删除部署,您仍将为实例付费.

还请注意,它是按一整小时收费的,因此,如果您部署并在10分钟后停机,则仍需支付一整小时的费用.或者,如果您在上午11:55部署并在下午12:15删除,则需要支付2个小时的费用.

来自 http://www.windowsazure.com/zh-CN -us/pricing/details/cloud-services/#

如果我已部署的实例处于已停止"状态,我是否仍需付费?

是的,停止的实例仍会占用为实例供电的计算资源,因此您仍然需要付费.为了停止计费,您需要删除您的部署.

如果我的Web角色或Worker角色部署了不到一个小时,我需要支付多少费用?

云服务根据您的服务部署的时钟小时数计费.如果部署在一个时钟小时内超过五分钟,则将任何不足一小时的钟点计费为一整小时.如果您的服务部署时间少于一个小时,则可能需要支付零,一两个小时的费用,具体取决于部署发生的时间.例如,如果您在10:50 AM部署一个小型Cloud Services实例并在11:10 AM删除它,则会向您收取2小时的费用,一个小时用于10:50 AM至11:00 AM,另一个小时用于在11:00 AM和11:10 AM期间使用.

I'm trying to figure out how to (roughly) calculate some expected costs for some worker roles I'm thinking about creating.

TLDR;

Does azure charge you $$ if your worker is Sleep(someTime) / Sleeping?


Details

The Azure Pricing Page states their pricing, per hour and per VM size.

So to keep my question simple lets pretend I want to have 3 workers and each worker will be on a Small (A1) instance.

Now - the kicker is this => time!

So lets also pretend, that this is exactly what each worker does.

Worker 1 : Do-Some-Work-That-Takes-1-Second-Exactly. Sleep(59000);

Worker 2: Do-Some-Work-That-Takes-5-Seconds-Exactly. Sleep(550000);

Worker 3: Do-Some-Work-That-Takes-10-Seconds-Exactly. Sleep(50000);

So, worker 1 works for 1 sec, then sleeps for a 59 seconds. Worker 2: 5 secs + 55 secs sleep. Worker 3: 10 secs + 50 secs sleep.

The idea, every minute the workers will 'kick off', doing their work.

** Yes yes i know the real time work will be variable .. but lets keep this simple **

So, for each worker, will they get charged for each minute (work + sleep) or just the time they are working?

Eg. 1 sec + 5 secs + 10 secs = 16 secs per minute. = 16 * 60 = 960 secs per hour of work

and if there's 3600 seconds in an hour .. that means it's just under 4 hours or real life time before I get charged for 1 hour of 'work' ?

解决方案

Worker and Web Roles are charged per hour of deployment so even if doing nothing it is being charged out as you have physically commission the vm to be spun up.

Even if the role is stopped but the deployment hasn't been deleted you will still pay for the instance.

Also note, it is charged for the full hour so if you deploy and take down 10 minutes later you still pay for entire hour. Or if you deploy at 11:55am and delete at 12:15pm you will pay for 2 hours.

From http://www.windowsazure.com/en-us/pricing/details/cloud-services/#

If my deployed instance is in the "stopped" state, do I still get billed?

Yes, a stopped instance still occupies the compute resource that powers the instance, and therefore you still get billed. In order to stop billing, you need to delete your deployment.

If my Web or Worker role was deployed for less than an hour, how much do I get billed for?

Cloud services are billed based on the number of clock hours your service was deployed. Any partial clock hour is billed as a full hour if the deployment was longer than five minutes within one clock hour. If your service was deployed for less than an hour, you may get billed for zero, one or two hours depending on when the deployment happened. For example, if you deploy a small Cloud Services instance at 10:50 AM and delete it at 11:10AM, you will be billed for two hours, one hour for usage during 10:50 AM to 11:00 AM and another hour for usage during 11:00 AM and 11:10 AM.

这篇关于睡眠时,Azure Worker角色是否需要向$$收取费用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆