3

I am interested in understanding the way in which the hardware resources (CPU, disk, network, etc.) of an AWS physical server is shared between different applications. Do people have experiences about inexplicable performance changes in services running on AWS that you have successfully attributed to another application sharing the physical resources? If so, how did you go about debugging this?

In particular, I am interested in more complicated interactions between the resources, such as CPU->Memory bandwidth. If you run 15 VMs on a single machine, you will surely have worse performance than if you ran 2 VMs.

Perhaps this is a more general question about Xen virtualization, but I don't know if there is some kind of AWS magic happening under the hood that I don't know about.

I am not sure if this is the right forum for this kind of question; if not, it would be helpful if you could point me towards a resource or another forum.

user3249763
  • 117
  • 3
  • 15
  • 1
    If folks are interested in creating a venue for these types of cloud-related, non-programming questions, help support the proposal for a [dedicated Cloud Computing site on StackExchange](http://area51.stackexchange.com/proposals/96256/practical-cloud-computing). – John Rotenstein Nov 05 '16 at 23:58
  • Also see [Does EC2 dedicated instance share RAM bandwidth?](https://stackoverflow.com/questions/54398215/does-ec2-dedicated-instance-share-ram-bandwidth/60226979) – bain Feb 14 '20 at 13:09

1 Answers1

9

Amazon EC2 instances are not susceptible to "noisy neighbour" problems.

Based upon the Instance Type selected, the EC2 instance receives CPU, Memory and (for some instance types) locally attached disk storage. These resources are dedicated to the instance and will not be impacted by other users nor other virtual machines. (An exception to this is the t1 and t2 instance types.)

Specifically:

  • The instance is allocated a number of vCPUs. These are provided to the instance and no other instance can use these vCPUs (see note about t1 and t2 below). The EC2 Instance Type page defines a vCPU as:

Each vCPU is a hyperthread of an Intel Xeon core for M4, M3, C4, C3, R3, HS1, G2, I2, and D2.

  • The instance is allocated an amount of RAM. No other instance can use this RAM. There is no oversubscription of CPU nor RAM.
  • The instance might be allocated locally-attached disk storage, known as Instance Store or Ephemeral Storage. This disk storage does not persist when the instance is Stopped or Terminated, so only store temporary data or data that is replicated elsewhere.
  • The instance is allocated network bandwidth that is dedicated to that instance. No other instance can impact this network bandwidth. The network performance is based upon the selected instance type. Basically, larger instances receive more network performance.

None of the above factors are impacted by other instances (virtual machines) running on the same host.

t1 and t2 instance types

An exception to the above statement are:

  • t1.micro instances "provide a small amount of consistent CPU resources and allow you to increase CPU capacity in short bursts when additional cycles are available".
  • t2 instances provide burst capacity based upon a system of CPU Credits. CPU Credits are earned at a constant rate depending upon instance type, and these credits can be used to burst the CPU when necessary.

For both these instance types, I would assume that this burst capacity is shared between instances, so it is possible that CPU burst might be impacted by other instances also wishing to burst. The t2 instances, however, would make this 'fair' by only consuming CPU credits when the CPU did actually burst.

Dedicated Instances and Dedicated Hosts

  • Dedicated instances are "Amazon EC2 instances that run in a virtual private cloud (VPC) on hardware that's dedicated to a single customer." Basically, your AWS account will be the only account running instances on that host computer.
  • A Dedicated Host is a "physical server with EC2 instance capacity fully dedicated to your use. Dedicated Hosts allow you to use your existing per-socket, per-core, or per-VM software licenses, including Windows Server, Microsoft SQL Server, SUSE, Linux Enterprise Server, and so on." Basically, you pay for the entire host computer and then launch individually instances on the host (at no additional charge).

The use of a Dedicated Instance or a Dedicated Host has no impact on resources allocated to each instance. They would receive the same resources as when running as a normal Shared Instance.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • *"The t2 instances, however, would make this 'fair' by only consuming CPU credits when the CPU did actually burst."* You may remember my [alarmingly thorough analysis](http://stackoverflow.com/a/32289481/1695906) of how CPU credits work on t2 machines. Credits are actually being consumed whenever the core is being used at all -- they're just consumed faster than they're earned, when bursting. It's mathematically plausible that cores could be shared, but since the memory isn't shared, max VMs per host are still limited, thus core oversubscription seems somewhat unlikely to me, even for t2. (+1) – Michael - sqlbot Nov 06 '16 at 03:33
  • Thanks for the answer. I understand that there is resource isolation, but what about more complicated interactions between the resources, such as CPU->Memory bandwidth. If you run 15 VMs on a single machine, you will surely have worse performance than if you ran 2 VMs. I will update the question to make this point clear. – user3249763 Nov 06 '16 at 04:28
  • Do dedicated instances(without a dedicated host) share RAM bandwidth of CPU? – huseyin tugrul buyukisik Jan 27 '19 at 14:15
  • @huseyintugrulbuyukisik Please ask a new question rather than asking in a comment in an old question. (To answer: No Amazon EC2 instances 'share' anything.) – John Rotenstein Jan 27 '19 at 23:17