{
"$type": "site.standard.document",
"canonicalUrl": "https://justingarrison.com/blog/2023-02-23-ec2-names-explained",
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreiguncc7n2n27lfqmwbtju7cii6oy7jbtcsuknlnaymcllnrdgbkpi"
},
"mimeType": "image/png",
"size": 63280
},
"description": "Decoding EC2 instance type names to understand which is best for you. With free infographic.",
"path": "/blog/2023-02-23-ec2-names-explained",
"publishedAt": "2023-02-23T00:00:00.000Z",
"site": "at://did:plc:p7uix7mresfq4nfzxp3klgfa/site.standard.publication/3mmdn7mg2qm2d",
"textContent": "Amazon Elastic Compute Cloud (EC2) has over 100 unique instance types with more than 600 size combinations.\nPicking the right instance type can be a difficult task for even the most seasoned engineer.\nRunning an application on the largest, fastest instance you can afford does not guarantee the best performance.\n\nIf you've ever wanted to understand instance type names or need help picking the right instance for your application you've found the right article.\nHere's a moving picture version of this blog post.\n{{< youtube bfjDLbHnhBw >}}\n\nAnd here's a static picture version of the same information.\n\nA quick disclaimer, I work at Amazon but this is my personal blog reflecting my personal opinion.\nAll of the information was gathered from public sources and from my experience.\nI wrote this because I wished I had it as a guide when I was first learning EC2.\n\n!infographic of ec2 families, generations, capabilities, and sizes.\nFull image here PDF here\n\nInstance names are made up of four sections.\n\n Family\n Generation\n Capabilities\n Size\n\nSo how do you decipher an instance with the name r7iz.8xlarge?\nFrom the info above we know r is from the memory family which has more memory per vCPU than general purpose.\nSpecifically it has 8 GiB of memory for every 1 vCPU.\n7 means it's a 7th generation instancy type.\nThe iz capabilities has a Intel processor (i) running at turbo frequencies (z), and 8xlarge is 8 times bigger than a r7iz.xlarge.\n\n!an example instance name r7iz.8xlarge\n\nMany capabilities aren't listed in the name because some families include capabilities by default.\nFor example, the m family are all EBS and network optimized by default which is usually denoted with the b and n capabilities.\nSome of the larger m instances have have local NVMe storage which adds d to the name.\n\nThese capabilities aren't always obvious so you're going to have to learn about what's available.\nThe good thing is you don't need to memorize _all_ of the instance types.\n\nKnowing one instance from the four most common families—general purpose (m), compute (c), memory (r), and storage (d or i)—will get you started with almost any application.\nHere's more info about each of the family groups and types.\n\nFamilies\n\nInstance families come in six different groups:\n\n General Purpose\n Compute\n Memory\n Accelerated\n Storage\n HPC\n\nMost categories have multiple type options that refine instance features.\n\nGeneral Purpose\n\nGeneral purpose instances keep a balance between vCPU, memory, and network performance.\nSome instances add aditional capabilities to CPU (z) and network (n) and there are multiple CPU options for AMD (a), Intel (i), or graviton (g) chips.\n\nThe general purpose group includes: A, M, Mac, T\n\nThese are often used as web servers because they have a balance of resources.\nThe t types can save you money with their burstable vCPU options and are a good choice if your workload CPU usage is similar.\n\nThis is the only group with Mac instances which can be used for remote macOS workstations or build farm systems that need Apple tools.\n\nCompute Optimized\n\nCompute optimized only includes the c type instance with different generations, capabilitities, and sizes.\nAlmost every c instance has a 2:1 ration of memory to vCPU.\nIf you use a medium instance with 1 vCPU it will have 2 GiB of memory.\nIf you use a 32xlarge with 128 vCPUs it will have 256 GiB of memory.\n\nThese instances are ideal if your workloads need a lot of CPU power and not as much memory.\n\nMemory Optimized\n\nMemory optimized instances are for workloads that consume more memory than CPU.\nThey have a memory to vCPU ratio ranging from 4:1 up to 32:1.\nAn instance like r6i.xlarge has 4 vCPUs and 32 GiB of memory while an x2iedn.2xlarge has 256 GiB of memory with 8 vCPUs.\n\nMemory optimized are some of the best instances for clusters like Kubernetes because many workloads are memory bound more than CPU bound.\nThis will let you pack an instance with more workloads than types with lower memory to vCPU ratios.\n\nThe memory optimized group includes: R, U, X, Z\n\nAccelerated Computing\n\nAccelerated computing is the most specialized of all of the groups.\nIf you need specialized compute acceleration for your workloads you probably already know.\n\nMost of these instance types have GPU accelerators or specialized machine learning chips.\nThe only non-machine learning special accelerators are the f1 instances with field programmable gate arrays (FPGAs) and vt1 with Xilinx U30 media accelerator cards.\n\nAll of the types have a variety of local storage and high memory.\nThe GPU types—g and p—have multiple video cards options with varying sizes of GPU memory.\nSome instances have multiple accelerators but not all accelerators can be shared with workloads at the same time.\n\nIt's more important to chose the appropriate size for these instances to optimize your usage and keep your costs low.\n\nThe accelerated computing group includes: DL, F, G, Inf, P, Trn\n\nStorage Optimized\n\nStorage optimized is exactly what you might think—lots of throughput at low latency.\nAll of these instances will have local storage of various sizes.\nFor most of the instances the memory to vCPU ratio is either 4:1 or 8:1.\n\nAll that disk IO wouldn't be very useful without good network throughput and these instances generally have more network performance at smaller instance size than any other type.\nThey don't have the fastest network available, but faster than many of the general purpose instance types.\n\nStorage optimized group includes: D, H, I, Im, Is\n\nHPC Optimized\n\nThis group only hase one type HPC with 2 options, the hpc6id.32xlarge or hpc6a.48xlarge.\nYou can get a big instance with Intel (i) or AMD (a) processors with the main benefits being no hyper-threading and lots of network bandwidth.\n\nIf you want HPC instances you have a _very_ specific need that needs either 16:1 or 8:1 memory to CPU ratio.\nThey are only available in us-east-2 and GovCloud regions so don't expect to use these in multi-region deployments.\n\nGenerations\n\nGenerations are a number 1 through 7 and corelate to how many versions of the instance family has had.\nOlder generations are eventually retired and replaced.\n\nInstance type generations include improvements in processor generations, memory speed, and network performance.\nIntel based instances usually jump a generation when a new generation of chips are used.\nI personally can never remember what lake generation is the best with Intel so I use the highest EC2 generation possible.\n\nGraviton also jumps architecture versions with generations.\nARM based 1st generation types are using Graviton 1, generations 2-6 are using Graviton 2, and generation 7 is using Graviton 3 (or 3E).\nGraviton 3 includes support for DDR5 which is another example of general performance improvements in newer generations.\n\nAmazon Nitro is the computer in the computer.\nNitro is a series of physical cards that are installed in an EC2 physical server.\nThere are a lot of great re:Invent talks that dive deep into Nitro if you want to learn more.\n\n{{< youtube jAaqfeyvvSE >}}\n\nAll modern EC2 instance generations are powered by Nitro.\nEven previous generations that historically were not powered by Nitro are being converted into Nitro based instances.\n\nIt's usually a good idea to switch to new generations for price and performance benefits, but often times the current generation -1 are the most widely available.\nThere will likely be more regions that have the previous generation and each region will have higher quantities.\n\nCapabilities\n\nCapabilities—sometimes called attributes—identify specific implementations or additional features about the instance.\nAs mentioned earlier, some types have the capabilities by default.\nIn that case the letter isn't added to every instance but it is assumed because of the instance type itself.\n\nSome of the capabilities are mutually exclusive.\nYou couldn't have an instance with ag because those are both processor capabilities and there's no such thing as an AMD Graviton.\nThe most complicated capabilities usually include dn or en because those add storage and network performance.\nA x2iedn.2xlarge is one of the instances with the most capabilities specifying that it is an Intel processor (i) with a higher memory to vCPU ratio of 32:1 (e), local storage (d), and faster network (n).\n\nThe additional capabilities are:\n\n a – AMD processors\n g – AWS Graviton processors\n i – Intel processors\n d – Instance store volumes\n n – Network optimization\n b – Block storage optimization\n e – Extra storage or memory\n z – High frequency\n\nSize\n\nInstances sizes are almost always twice as big than the previous size.\nA large is twice as big as a medium and an xlarge is twice as big as a large.\nThe multiples of xlarge are almost always powers of 2 (2, 4, 8, 16), but there are 10xlarge, 12xlarge, and a few other odd xlarge numbers that exist.\nThe main thing with sizes is the vCPU and memory count increase linearly so if you know the ratio of a family or one of the sizes you can figure out the larger sizes too.\n\nNetwork throughput and storage do not increase linearly and those are often harder to figure out.\nMany instances have a size where there is a jump in network performance or storage and everything above that size is consistent.\n\nSize is hardest to figure out with shared resources like a Kubernetes cluster.\nDepending on which workloads are scheduled to which instances will give you a wide variety of performance if you're not careful.\nWe recommend specifying the instance type or size your workload needs directly in the manifest with a nodeSelector for consistent performance.\n\nChoosing the best instance\n\nThe first thing you need to do when picking an instance type is understanding your workload's needs.\nYou need to find the bottlenecks and limits of your application before you decide on an instance to use.\n\nBenchmarking on your laptop is _not_ the right approach.\nUnless youre doing remote development in EC2, your local development environment is _very_ diffe",
"title": "Amazon EC2 names explained"
}