GCP Compute Engine Complete Analysis: How do I choose the best VM instance for you?
In the world of cloud computing, Google Cloud Platform (GCP) has attracted countless companies and developers with its powerful global network and Google's own black technology. And
Compute Engine (GCE)
The virtual cloud server (VM) in GCP is the first stop for most people to enter GCP.
However, when you confidently open the GCP console and prepare to build a new virtual machine, reality often throws cold water on you. The menu is densely covered with dozens of model codes:
e2-standard-4
,
n2-highmem-8
,
c3-highcpu-16
,
t2d-standard-2
……
It feels like you walked into the world's largest car 4S store, and the salesperson introduced dozens of models to you at one go, including a two-seater electric grocery cart, a large truck capable of pulling 10 tons of goods, and a V8 engine Supercar.
The cost of choosing the wrong model is painful: either you bought a sports car configuration for the light business and saw the bill dripping blood every month; Either you match the high concurrent business with an electric vegetable cart, and the traffic will rush slightly and the website will be paralyzed immediately.
In today's article, we use the vernacular to thoroughly dig into the selection logic of GCP Compute Engine, taking you around the professional terms of official documents and selecting the "native VM" that is most suitable for your business ".
The four 1. families are divided: what kind of business scenario do you belong?
Although GCP has many machines, Google has very kindly divided them into four categories (ML/GPU belongs to special equipment, and today we will mainly talk about general computing power). If you understand these four families, you are halfway through the selection.
1. Universal (General-Purpose) -the "bucket machine" in the team"
Representative models: E2, N2, N2D, Tau T2D, C3
Core expertise: cost-effective, balanced development in all aspects. The ratio of CPU to memory is usually the classic 1:4 (such as 2-core 8G, 4-core 16G).
Who is suitable for: small and medium-sized Web site backend, development and testing environment, daily API interface server, microservice container.
Vernacular advice: If you are a new project online, or do not know the future traffic characteristics of the business, close your eyes to choose E2 or N2 will never go wrong. E2, in particular, is GCP's money-saving killer, which uses dynamic resource allocation technology and is so cheap that it is very suitable for light-weight business at the bottom of daily life.
2. Computational optimization (Compute-Optimized) -unemotional "accounting machines"
Representative models: C2, C2D, C3
Core expertise: single-core performance is extremely strong, synonymous with high-frequency computing. Its CPU
The base frequency is very high, and the memory is relatively restrained (the ratio is usually 1:2 or 1:4).
Who is suitable for: high-performance Web servers (such as Nginx agents with ultra-high concurrency), video codecs, game servers, and scientific computing.
Big vernacular advice: If your business runs complex mathematical formulas in the background every day, processes large-scale images, or is extremely sensitive to delay in the back end of the game, choosing the C2 family will give you the feeling of flying.
3. Memory-optimized (Memory-Optimized) -a "walking dictionary" with great capacity"
Representative models: M1, M2, M3
Core specialty: memory is too big to imagine. This type of model often provides hundreds of GB or even several TB of large memory, specifically designed to swallow massive data directly into the memory.
Suitable for: large memory databases (such as SAP HANA and Redis clusters), large relational databases (such as giant MySQL/Oracle branches), and high-throughput real-time big data analysis.
Big vernacular advice: as long as your business is stained with the words "large database" or "memory computing", don't struggle, go directly to the M family to pick machines.
The "secret letter" in the 2. suffix: Intel, AMD or ARM?
After choosing the family, you will find that it is followed by some strange lowercase letters, such
N2
,
n2d
,
T2a
. These letters represent the real lying behind this virtual machine.
Physical CPU chip manufacturers
. In the cloud, choosing the right chip allows you to achieve performance spikes without spending a penny.
No special letters (e. g. N2, C2): Intel processors are used by default. The chip of the old empire has no stability to say, and its compatibility is the first in the world. If your old enterprise software is extremely demanding on hardware, Intel is the safest choice.
Models with d (e. g. N2D, C2D): AMD (Chaowei Semiconductor) processors are used. Commonly known as "AMD, yes!". On GCP, the price of AMD models is usually 10% to 15% cheaper than that of Intel models with the same configuration, and they perform even better when handling multi-threaded concurrent tasks.
Models with a (e. g. T2A): ARM architecture processor (Google self-developed or custom chip). This is a big trend in the cloud in recent years. As long as your code (such as Go, Python, Java, Node.js) can be compiled and run perfectly under ARM architecture, ARM model is the absolute ceiling of cost performance, which can help you save a lot of server money.
GCP Exclusive Money Saving Hacking Tips for 3. Old Drivers
If you don't learn the following three advanced "bonus hunter" skills, you will send Google a lot of money every month.
1. Don't touch yourself
Define (Custom) models, unless absolutely necessary
GCP has a cool feature: it allows you to freely combine CPU and memory. For example, you can pull a "3-core 11G" exotic machine yourself.
The truth is: Google has set an invisible markup for this flexibility. The single-core/single-G unit price of the custom model is actually much more expensive than the officially configured preset models (Standard, High-CPU, etc.). Try to adapt your business to the official preset specifications, which is the right way to save money.
2. Recognize the ace of GCP: Preemptive VMs (Spot VMs)
If you lose one or two of your business, it doesn't matter at all (such as distributed picture transcoding, offline big data running, or your personal test toy), you must open it.
Spot VM
.
Principle: This is using the idle computing power in Google's data centers. As long as others need it, Google may forcibly take back the machine within 30 seconds.
Return: As a price, Google will give you a 20% to 40% discount directly! Enjoy the top configuration at a very low price, and the price/performance ratio is simply breaking through the sky.
3. Save money automatically with the Continuous Use Discount (SUD)
Many domestic cloudy manufacturers need you to buy one-time for one or three years (package year and month) before they give you a discount. However, GCP is very Buddhist and humanized: if you buy a classic model such as N1 or N2, even if you choose to charge by volume, as long as the machine runs for more than 25% within a month, GCP will automatically give you a discount when you check out at the end of the month.
The longer you use it, the greater the discount, with a maximum discount of 70%.
You don't have to do anything, the discount will be automatically credited.
4. three actual combat business configuration recommendation
In order to make everyone more intuitive, here are three sets of proven "star formulas" for production environments ":
Business Scenario
Recommended Model Specifications
Reasons and core highlights
Start-up MVP/Personal Testing/Lightweight Microservices
e2-micro or e2-small
Extremely cheap and leverages GCP's shared core technology. When there is no traffic at ordinary times, it hardly costs money, and when there is sudden traffic, it can sprint for a short time.
Enterprise main Web background/core API interface
n2d-standard-4 (4 core 16G)
The AMD chip is directly cheaper than the Intel version of n2. Multi-core benefits Handle highly concurrent, multi-threaded network requests with ease.
Small and Medium MySQL / Redis Cache Nodes
n2-highmem-4 (4 cores 32G)
The database is the standard "memory-eating monster". highmem specifications significantly increase the memory ratio, ensure that indexes and caches can be stably resident in memory, and eliminate disk I/O bottlenecks.
Conclusion
Select the machine in the GCP Compute Engine,
The core philosophy is never "the pursuit of the most expensive, the strongest", but the pursuit of "just the right dynamic balance".
The reason why Google has divided the models so delicately is to enable you to accurately stick every budget on the blade of the business like Lego. Using E2 family to carry daily life, using AMD (with D model) and ARM (with A model) to cut off the price moisture, and then using Spot VM to check the leakage and fill the vacancy, you can not only harvest a rock-solid cloud architecture, but also show a heartfelt smile when you see the bill with great cost performance at the end of the month.

