你有多少个角色可以为每个Azure的实例 [英] How many roles can you have per Azure instance

查看:183
本文介绍了你有多少个角色可以为每个Azure的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,你只能有每个实例1 Web角色,但这并不适用于背景的角色呢?更详细地可以在1实例中运行的背景下角色和Web角色?

I know that you can only have 1 web role per instance but does this apply to Background roles as well? In more detail can 1 instance run a background role and a web role?

推荐答案

我觉得在你的问题中使用的术语迷惑对方应答。

I think the terminology used in your question is confusing the other responders.

在Windows Azure的计算,你有一个云服务。云服务可以被认为是你的整体架构,或者至少前端,中间层,等等(这里有计算,而不是存储任何级别)。例如你的应用程序可能有一个presentation前端(ASP.Net MVC的Web应用程序)和中间层(超过基本的HTTP WCF服务层)。好比我们每个层级,以角色。所以在上面我举的例子,我会在我的云服务2 Web角色。我可能也有一些后端处理这确实某种批次的工作,这将是一个角色也。该用户交互,如网站,服务层等应对角色托管为Web角色,而这些后端服务宗旨是辅助角色。

In Windows Azure compute, you have a cloud service. A cloud service can be thought of as your overall architecture, or at least the front end, the middle tier, etc (any tier where there is compute as opposed to storage). For example your application might have a presentation front end (ASP.Net MVC web application) and a middle tier (WCF service layer over basic http). We liken each of these tiers to "roles". So in my example above, I would have 2 web roles in my cloud service. I might also have some back end processing which does some sort of batch work, this would be a "role" also. Roles that respond to user interaction such as web sites, service layers, etc are hosted as "web roles" while those back end services are "worker roles".

然后我们有实例。一个实例是很多虚拟机的配置方式,以提供给定角色的功能。例如,我可能需要我的presentation层有5个实例,因为它需要大量的负载。所以,我的1 Web角色有5个实例。同样,我的中间层,服务层,可能只需要3个实例(因为presentation层缓存的),等于是我1 Web角色有3个实例。我的后端服务可能只需要1个实例,因为它的工作是可以做到无论何时,但如果回日志变得太大,它可以扩展到10个实例通过工作来获得,然后缩减到1再次实例。

Then we have instances. An instance is how many virtual machines are provisioned to provide the functionality of a given role. For example, I might need my presentation tier to have 5 instances because it takes a lot of load. So, my 1 web role has 5 instances. Likewise my middle tier, a service layer, might only need 3 instances (because of presentation tier caching) and so therefore my 1 web role has 3 instances. My back end service might only need 1 instance since its job can be done whenever, but if the back log gets too big, it could scale up to 10 instances to get through the work, then scale back down to 1 instance again.

所以这里的关键是,你可以为每个角色1个或多个实例。由于这种关系,这是有道理的,你可以有每个实例只有一个角色(因为一个实例从一个角色模板实例化)。

So the key here is that you can have 1 or more instances per role. Because of this relationship it makes sense that you can have only one role per instance (since an instance is 'instantiated' from a single role template).

什么的Rinat想说的是上面您可以用辅助角色欺骗和WCF实际上主持HTTP终点,从而获得Web角色类型的行为,但是你没有得到的Web角色时,负载均衡你做这个。同样,Web角色可以通过覆盖在WebRole.cs OnStart方法有工作者角色样式的行为。不过,我还是会说这是在两种情况下只有一个角色,你可以有一个角色的多个实例。

What Rinat was trying to say above was that you can cheat with the worker role and actually host a http end point in WCF, thus getting web role type behavior, however you don't get the load balancing of a web role when you do this. Likewise, a web role can have worker role style behavior by overriding the OnStart method in the WebRole.cs. However I would still argue this is just one role in both cases, and you can have multiple instances of that role.

比约恩是表示在默认情况下你在每个角色20个实例封顶,但是你可以得到更多的(所以他不值得-1恕我直言)。

Bjorn was indicating that by default you are capped at 20 instances per role, however you can get more (so he doesn't deserve a -1 IMHO).

希望这会清除它。

这篇关于你有多少个角色可以为每个Azure的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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