Amazon EC2 5th Generation Instance Selection Guide: Stop blindly choosing models and old drivers build "cost-effective" cloud computing power avoidance secrets
In the cloud computing world of AWS,
EC2(Elastic Compute Cloud)
It is absolutely the core cornerstone that carries all your business. However, as long as you log into the AWS console and click on the page of "Start Instance", you will be stunned by the dense, gobbledygook-like model code:
c5.large
,
m5.xlarge
,
r5.2xlarge
... followed by various belts
d
,
n
,
a
,
g
The odd-shaped suffix.
Many students who have just come into contact with AWS, or business teams eager to go online, often choose the default one directly to save trouble, or pick a model that "feels similar.
It's like you bought a computer, obviously just to write a Word and look at the web page, but you spent 20,000 yuan to buy a workstation with dual video cards. Or you obviously want to do high-frequency 3D rendering, but bought a thin office book, the result card every day doubt life.
On the cloud, the price of this blind selection is
The white silver floats
, or
Frequent crashes as soon as the business goes online during a peak period.
.
Although AWS has now launched the sixth generation, seventh generation and even newer instances
The fifth generation instance (Generation 5) is still the most widely deployed, cost-effective, and stable "mainstay" in current enterprise applications"
. In today's article, we will use the vernacular and not pile up obscure official documents to thoroughly help you understand the selection logic of EC2 5th generation instances, so that you can buy them right and save them!
1. to understand the code name: the "morse code" behind the EC2 instance name"
Before picking out the machine, let's take a minute to pierce the EC2 naming rules. In fact, its name is very regular, just like the naming of cars:
m 5 d . xlarge
[family] [generation] [characteristic] [specification]
The first letter (family/family): represents the main gene (core specialty) of this machine. Is it good at calculation? Or is it good at storing data? Or is it all-round development?
Second digit (generation/Generation): indicates which generation of product this is. The higher the number, the newer the architecture, and generally the higher the price/performance ratio and performance. For example, M5 is definitely faster and cheaper than the older generation of M4.
The following lowercase letter (additional features): This is a "bonus item" that many people easily ignore: a: It means using AMD's processor (the price/performance ratio is usually higher than Intel). G: The representative uses the Graviton architecture processor developed by AWS (based on ARM architecture, saving money and killing money). d: represents native solid state with NVMe protocol
Hard drive (Instance Store). This disk is extremely fast in reading and writing, and the shutdown data will disappear, but it is very suitable for cache or temporary exchange area. n: indicates that the network bandwidth is large (Network), which is suitable for businesses that need to insanely process network data.
The part after the point (size/size): represents how big this machine is. Double the configuration from large, xlarge to 24xlarge.
2. the fifth generation of the three main family: which chair are you suitable?
In the fifth generation example, the core and most frequently flipped brand is
M5, C5, R5
This troika. We disassemble them with the most vivid business scenarios.
1. M5 family-the "all-round butler" in the team (universal)
Resource ratio: Its vCPU and memory (GiB) ratio is usually 1:4 (such as 2-core 8G,4-core 16G).
Live popular explanation: this is a very balanced development of all aspects of the machine, there is no obvious short board.
Who's right for: Web site backstage for small companies. Enterprise development, testing, pre-release environment. Various small and medium enterprise applications, code warehouses, log collection servers.
If you don't know what to choose, or if your business is just starting and you can't see the traffic characteristics clearly, you won't make a big mistake by choosing M5 blindly first.
2. C5 Family-Computing Maniac and Emotionless Typewriter (Computing Optimized)
Resource ratio: its vCPU and memory ratio is 1:2 (e.g. 2-core 4G,4-core 8G). The memory is relatively small, but the CPU performance is very sufficient, mainly equipped with high-performance Intel Xeon or AMD EPYC processors.
Real people popular explanation: it is like a crazy overtime accounting master, the brain turns fast, but its memory is not very good (small memory), only suitable for dealing with tasks that require a lot of calculation, can be lost after calculation.
For whom: High-performance web servers (such as high-concurrency Nginx proxies). Scientific computing, data modeling, ML reasoning, batch data processing. Logical backend for video encoding, image transcoding, and game servers.
If your application eats CPU in particular, but the memory is idle every day, switching to C5 will save you a lot of money immediately.
3. R5 Family-Large Capacity "Living Dictionary" (Memory Optimized)
Resource ratio: its vCPU and memory ratio is as high as 1:8 (such as 2-core 16G,4-core 32G).
Real people popular explanation: this is a good memory to go against the day "student bully". Although the calculation speed is similar to that of M5, it has a massive and spacious memory space, which can directly swallow massive data into the stomach (memory) and read it at any time.
For whom: various databases (MySQL, PostgreSQL, SQL Server). High-performance caching services (Redis, Memcach
ed). Real-time analysis of big data (such as single-node or distributed Spark/Hadoop components).
As long as your business is stained with the words "database" or "cache", don't say anything, please go directly to R5.
3. practical avoidance and money-saving "hacker" skills
Choosing the right family is only the first step. When actually spending money on machines, veteran drivers often use the following three techniques to further reduce their bills.
Tip 1: Look more at the band
a
suffix (such as m5a, c5a)
This is a money-saving secret that many people don't know. The default
m5
It uses Intel chips, and
m5a
It adopts
AMD
of the chip.
In most daily web development and API services, there is almost no perceptible difference between the performance experience of Intel and AMD. But!
The price of AMD models on AWS is usually about 10% cheaper than that of Intel models.
Just changing a lowercase letter when creating an instance can save months of server overhead in a year.
Tip 2: distinguish between EBS cloud disk and instance storage (
d
the difference)
For example
c5
and
c5d
.
c5d
It's a little more expensive, but it comes with an NVMe solid-state drive that plugs directly into the host machine.
Note: This disk is a "temporary disk". As soon as EC2 shuts down (Stop), the data inside will be completely erased (restart Reboot will not be lost).
Wonderful Use: Never use it to store business codes or database files! However, you can use it to store the system's temporary cache (Swap space), temporarily generated logs, or intermediate process files for big data calculations. The read/write speed and latency of this local disk are completely unmatched by ordinary EBS remote cloud disks, which can greatly improve the concurrent throughput of the machine.
Tip 3: Don't choose the specifications "one step in place"
Many novices like to "pay for the future" in advance. It is expected that the traffic will be large in the future and they will buy one as soon as they come up.
m5.4xlarge
.
In the world of cloud, this approach is very outdated. The biggest advantage of EC2
Elasticity
. The correct approach is:
At the beginning of the launch, according to the pressure test results, select a specification that is just right or even smaller (for example, m5.large). When the business really encounters a bottleneck, you only need to spend two minutes shutting down, modifying the instance type, and restarting it, and it will instantly upgrade to a big machine.
Don't let empty servers burn your money in the cloud every day.
Conclusion
Choosing an Amazon EC2 instance, essentially in
CPU, Memory, Network, Price
Play a seesaw game of dynamic balance in these four dimensions.
The fifth generation of instances, as the golden generation in the AWS ecosystem, provides an extremely detailed classification. Got it.
With the balance of M5, the ferocity of C5, the mass of R5, and the reasonable combination of AMD chips and the strategy of flexible lifting and lowering, you can firmly control the bill in your own hands while ensuring that the business is as solid as a rock. This is the "confidence" that a qualified cloud architect should have ".

