Windows Azure 中同一实例上的多个角色 [英] Multiple roles on the same instance in Windows Azure

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

问题描述

是否可以在同一个实例中部署多个角色?

Is it possible to deploy multiple roles in the same instance?

我有三个 web 角色(asp.net mvc3 中的网站,以及两个 WCF 服务实例)和两个辅助角色(windows 服务).

I have three web roles (website in asp.net mvc3, and two WCF services instances) and two worker roles (windows services).

此应用程序的负载非常小,因此我不想在 Windows Azure 中创建这么多实例并现在为所有实例付费.相反,我想在同一个实例中部署我的所有应用程序,如果我能从我的应用程序中获得一些收入,那么稍后再更改它.

The load for this application is very small, so I don't want to create so many instances in Windows Azure and pay for all of the instances now. Instead I want to deploy all my application in the same instance and change it later if I will get some income from my applications.

我在谷歌上搜索并找到了一些论坛帖子,有些可能有些则不可能……但我找不到如何操作的信息……

I Googled and found some forum posts than it's possible and some than it's not possible... but I can't find information how to do it...

所以两个问题:是否可以?我该怎么做?

So two questions: Is it possible? How can I do it?

推荐答案

与@Simon 的答案略有不同...角色实际上是 Windows Server 2008 VM 的模板(请参阅我在 这个问题也是如此).每个角色都有一个或多个实例,您可以在任何角色上运行您想要的任何内容.

A slightly different answer than @Simon's... A Role is actually a template for a Windows Server 2008 VM (see my answer on this SO question as well). Each role has one or more instances, and you can run whatever you want on any role.

您绝对可以在一个角色中运行您的网站和所有 WCF 服务.现在,您可以将应用程序向上/向下(VM 大小)和向外/向内(实例数量)扩展为单个缩放单位.例如,如果您的 WCF 服务是 CPU 密集型的,导致虚拟机实例对您的 Web 访问者来说变慢,那么您需要进行足够的横向扩展来处理这些访问者.

You can absolutely run your website and all your WCF services in a single role. You'll now scale your application up/down (VM size) and out/in (# of instances) as a single scale unit. If, say, your WCF services are CPU-intensive, causing the VM instances to slow down for your web visitors, you'll need to scale out enough to handle those visitors.

一旦您达到显着的流量负载,就值得考虑单独的角色.这样,您就可以决定每个角色的 VM 大小和数量.也许您有 2 或 3 个 Web 角色的小型实例来处理网站上的用户流量,并且可能有 2 个 Worker 角色的中型实例来处理 WCF 服务(仅作为示例).您拥有的角色越多,您拥有的扩展粒度就越细,但您必须至少为每个角色运行一个实例,这会提高您的静止系统"基准成本.

Once you reach a significant traffic load, it's worth considering separate roles. That way, you can decide on VM size and quantity per role. Maybe you have 2 or 3 Small instances of a Web role to handle your user traffic on the website, and maybe 2 Medium instances of a Worker role to handle WCF services (just as an example). The more roles you have, the finer-grain scaling you have, but you must run at least one instance of each role, which elevates your "system at rest" baseline cost.

这篇关于Windows Azure 中同一实例上的多个角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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