[英]Test multiple web role instances in the Azure emulator
I have a web role that will run on multiple instances on Azure. 我有一个Web角色,它将在Azure的多个实例上运行。 It is an MVC3 app that allows users to upload multiple image files. 这是一个MVC3应用程序,允许用户上传多个图像文件。 I'm using Plupload (http://www.plupload.com/) for uploads and the files are sent on chunks to the server. 我正在使用Plupload(http://www.plupload.com/)进行上传,并且文件以块的形式发送到服务器。
I would like to test how this works on multiple instances. 我想测试一下如何在多个实例上工作。 So I configured my cloud service to start 2 instances of my web role and put a breakpoint in my Upload action. 因此,我将云服务配置为启动2个Web角色实例,并在我的“上载”操作中添加了一个断点。 The problem is that all my requests are served by the first instance of the web role. 问题是我的所有请求都由Web角色的第一个实例提供。 I would like the requests to be balanced (but this could be an issue with how Plupload handles the upload). 我希望请求达到平衡(但这可能是Plupload如何处理上传的问题)。 Is there any way to simulate that behavior? 有什么方法可以模拟这种行为?
I have to say that the load balance of the local emulator was not that "balanced". 我不得不说,本地仿真器的负载平衡不是“平衡”的。 You need to try many times to ensure that it does route your request to all instances. 您需要尝试多次以确保它确实将您的请求路由到所有实例。 My experience is that, even though just have 2 instances and press F5 to refresh the same page, you need about 10 - 15 times to make sure it's balanced to another instance. 我的经验是,即使只有2个实例并按F5刷新同一页面,您也需要大约10到15次才能确保它与另一个实例保持平衡。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.