关于您在一个 Windows Azure 应用程序中具有“多个 webrole”的问题,我个人认为在单个应用程序中具有两个或多个 webrole 没有任何具体原因。在一个 web 角色中有两个 webrole 将导致一个角色使用端口 80 和其他一些端口(默认为 8080)用于其他角色。因为您将有一个 VIP 来处理两个 Web 角色,所以您不能在两个角色上都设置端口 80。在某些情况下,您可以将此类功能插入在端口 80 和 8080 上配置的单个 Web 角色中。我可以想到一个示例,即在一个应用程序中拥有两个或多个 Web 角色,其中用户希望从一个特定的 Web 角色为数百个用户提供服务它配置为具有多个实例的端口 80,但是在端口 8080(其他非 80)上配置的其他 Web 角色具有 1-2 个实例的管理站点。
Having web role and worker role in one Windows Azure application is very common scenario in which you can serve content through a web server configured over HTTP/HTTPS and have a worker role to do background processing without suffocating resources on web server. You can also configure internal endpoints by defining specific ports in Web and Worker role to communicate between Web role and worker roles internally over TCP endpoints. In this scenario you can have number of web role instances to handling web traffic and several instances of worker role for background processing separately. The best example for such scenario is like having a web site where users upload video content from a web server and once the content is upload, worker role star encoding the video and when the video is encoded the video is available on web server for users to enjoy. In real world scenario if you have 1,000,0000 users using such website, you might end up having 100s of instances of web and worker role to facilitate overall activity.