8

当我在 Azure 上运行辅助角色实例时,它是否是在共享主机(如 EC2)中运行的完整 VM?还是在共享系统(如 Heroku)中运行?

例如,如果我的应用程序开始请求 100 GB 内存会发生什么?它会因为违反限制而自动终止(例如 Google App Engine),还是只会耗尽 VM,以便 Azure 结构重新启动它?

两个角色是否曾经在同一个系统中运行?

4

2 回答 2

10

它是一个完整的 VM,分配的资源直接基于您选择的 VM 大小,从 1.75GB(小型)到 14GB(XL),具有 1-8 个内核。还有一个具有 768MB RAM 和共享内核的 Extra Small 实例。完整的 VM 大小详细信息在这里

在 Windows Azure 中,您的 VM 被分配在物理服务器上,并且结构有责任找到此类服务器以正确分配您的所有 Web 或工作角色实例。如果您有多个实例,这意味着跨故障域分配这些虚拟机。

使用您的虚拟机,如果您尝试在资源部门分配过多,您不必担心会被杀死:这就像拥有一台机器,您无法超越那里的内容。

至于在同一系统上运行的两个角色:每个角色都有实例,并且有多个实例,正如我上面提到的,您的实例被划分为容错域。例如,如果您有 4 个实例和 2 个容错域,那么您可能在同一个机架(或者可能是同一台服务器)上有两个实例。

于 2012-06-07T03:31:10.520 回答
3

I ran a quick test to check this. I'm using a "small" instance that has something like 1,75 gigabytes of memory. My code uses an ArrayList to store references to large arrays so that those arrays are not garbage collected. Each array is one billion bytes and once it is allocated I run a loop that sets each element to zero and then another loop to check that each element is zero to ensure that memory is indeed allocated from the operating system (not sure if it matters in C#, but it indeed mattered in C++). Once the array is created, written to and read from, it is added to the ArrayList.

So my code successfully allocated five such arrays and the attempt to allocate the sixth one resulted in System.OutOfMemoryException. Since 5 billion bytes plus overhead is definitely more that 1,75 gigabytes of physical memory allocated to the machine I believe this proves that page file is enabled on the VM and the behavior is the same as on usual Windows Server 2008 with the limitations induced by the machine where it is running.

于 2012-06-08T10:16:40.023 回答