All Products
Search
Document Center

Elastic Compute Service:Best practices for selecting ECS instance types

Last Updated:Sep 18, 2024

Before you purchase Elastic Compute Service (ECS) instances, you must select a cost-effective and stable instance type based on your requirements for performance, price, and workload. This topic describes how to select Alibaba Cloud ECS instance types based on your actual business scenarios.

Learn about instance families

  • Available instance types: For more information, see Overview of instance families.

  • Categories of instance families:

    Enterprise-level instance families, shared instance families, ECS Bare Metal Instance families, high-performance computing instance families, and heterogeneous computing instance families

    • Enterprise-level instances belong to a series of instance families that have been released by Alibaba Cloud since September 2016. Enterprise-level instance families provide high performance, consistent computing power, and balanced network performance. Enterprise-level instance families have exclusive and consistent computing, storage, and network resources, and are suitable for enterprise scenarios that require high business stability.

    • Shared instance families are a series of instance families intended for small and medium-sized websites or individual developers. Shared instances share resources, in contrast with enterprise-level instances that each have their own exclusive resources. As a result, shared instances do not provide consistent computing performance, but cost less.

    • ECS Bare Metal Instance families combine the strengths of physical machines and ECS instances to deliver powerful and robust computing capabilities. Using virtualization 2.0, ECS bare metal instances provide your business applications with direct access to the processor and memory resources of the underlying servers without virtualization overheads. ECS bare metal instances retain the hardware feature sets such as Intel VT-x and resource isolation capabilities of physical machines, which is suitable for applications that need to run in non-virtualization environments on the cloud.

    • High-performance computing instance families allow you to aggregate and scale computing capabilities and perform parallel computation to solve major challenges across multiple fields, including science, engineering, and commerce.

    • Heterogeneous computing refers to a system that contains computational units that use different instruction sets and architectures. In heterogeneous computing instance families, dedicated hardware is used in scenarios for which the hardware is best suited. In specific scenarios, heterogeneous computing instance families can outperform non-heterogeneous computing instance families by one or more orders of magnitude.

  • Naming conventions for instance types

    Each instance family name is in the ecs.<Instance family> format. Each instance type name is in the ecs.<Instance family>.<nx>large format.

    • ecs: is the product code of ECS.

    • <Instance family>: consists of an instance family name body and an instance family name suffix.

      Note

      The following tables describe the names of common instance types in instance families.

      • x86-based and Arm-based computing instance families

        Element

        Description

        Meaning

        Instance family name body

        Consists of lowercase letters and a number.

        • Lowercase letters: are an abbreviation that indicates the performance characteristics of the instance family.

        • The number: indicates the generation to which the instance family belongs.

          A larger number indicates a newer generation of instance families that are more cost-effective and deliver higher performance.

        • c: compute-optimized

          Compute-optimized instance families offer a CPU-to-memory ratio of 1:2 and are suitable for scenarios such as databases, web servers, high-performance scientific and engineering applications, game servers, data analytics, batch processing, video encoding, and machine learning.

        • g: general-purpose

          General-purpose instance families offer a CPU-to-memory ratio of 1:4 and are suitable for scenarios such as general-purpose Internet applications, databases, websites, Java application services, game servers, searches and promotions, and secure and trusted computing.

        • u: universal

          Universal instance families offer CPU-to-memory ratios of 1:1, 1:2, 1:4, and 1:8 and are suitable for enterprise-level users who are price-sensitive in scenarios such as small and medium-sized enterprise-level applications, websites and application servers, and small and medium-sized database systems, caches, and search clusters.

        • r: memory-optimized

          Most memory-optimized instance families offer a CPU-to-memory ratio of 1:8. Memory-optimized instance families are suitable for in-memory databases, data analytics and mining, distributed in-memory caches such as Redis, big data applications such as Kafka and Elasticsearch, and memory-intensive, general-purpose, and enterprise-level applications such as Java.

        • re: memory-enhanced or high memory

        • hf, hc, hg, and hr: high clock speeds or high frequency

          Instance families with high clock speeds offer CPU-to-memory ratios of 1:2, 1:4, and 1:8 and are suitable for scenarios such as massively multiplayer online (MMO) games, high-performance scientific computing scenarios such as high-performance computing, and large and medium-sized database systems.

        • i: local SSDs

          Instance families with local SSDs offer CPU-to-memory ratios of 1:4 and 1:8 and are suitable for scenarios such as online transaction processing (OLTP) and high-performance relational databases, NoSQL databases such as Cassandra and MongoDB, search scenarios that use solutions such as Elasticsearch, and E-MapReduce big data scenarios such as storage and computing separation.

        • d: big data

          Big data instance families offer a CPU-to-memory ratio of 1:4 and are suitable for big data computing and storage scenarios in which services such as Hadoop MapReduce, Hadoop Distributed File System (HDFS), Hive, and HBase are used and search and log data processing scenarios in which solutions such as Elasticsearch and Kafka are used.

        • s: shared

        • t: burstable

        • e: economy

        For example, ecs.g6.2xlarge is an instance type that belongs to the g6 general-purpose instance family and has eight vCPUs. g6 is a newer-generation instance family than g5.

        Instance family name suffix

        Consists of lowercase letters.

        • y: equipped with in-house Arm-based YiTian 710 processors

        • a: equipped with AMD processors

        • ae: AMD-enhanced

        • i: equipped with Intel processors

        • h: equipped with Hygon processors

        • re: RDMA-enhanced

        • se: storage-enhanced

        • ne: network-enhanced

        • t: security-enhanced

        • p: persistent memory-optimized

      • Heterogeneous computing instance families, ECS Bare Metal Instance families, and Super Computing Cluster (SCC) instance families

        Heterogeneous computing instance families, ECS Bare Metal Instance families, and SCC instance families are named based on in-house naming conventions. Each instance family name consists of lowercase letters and a number.

        Element

        Description

        Meaning

        Instance family name body

        Consists of lowercase letters.

        • gn: NVIDIA GPU-accelerated compute-optimized

        • vgn: NVIDIA GRID vGPU-accelerated dedicated

        • sgn: NVIDIA GRID vGPU-accelerated shared

        • gi: Intel GPU-accelerated compute-optimized

        • f: FPGA-accelerated compute-optimized

        • ebmc, ebmg, ebmr, ebmgn, and ebmhf: ECS Bare Metal Instance

        • sccc, sccg, scch, sccgn, and scchf: SCC

        Instance family name suffix

        Consists of lowercase letters and a number or only a number.

        • 6v: 6 indicates the Volta or Turing architecture, and v indicates V100 GPUs with 16 GB of memory each.

          For example, gn6v is a compute-optimized instance family that is powered by NVIDIA V100 GPUs with 16 GB of memory each based on the Volta or Turing architecture.

        • 6e: 6 indicates the Volta or Turing architecture, and e, which is short for extend, indicates second-generation V100 GPUs with 32 GB of memory each.

          For example, gn6e is a compute-optimized instance family that is powered by NVIDIA V100 GPUs with 32 GB of memory each based on the Volta or Turing architecture.

        • 6i: 6 indicates the Volta or Turing architecture, and i indicates T4 GPUs.

          For example, gn6i is a compute-optimized instance family that is powered by NVIDIA T4 GPUs based on the Volta or Turing architecture.

        • 6s: 6 indicates the Volta or Turing architecture, and s indicates sixth-generation SG-1.

          For example, ebmgi6s is a visual computing instance family that is powered by Intel® Server GPUs and sixth-generation SG-1.

        • 7: indicates the Ampere architecture.

        • 7i: 7 indicates the Ampere architecture, and i, which is short for inference, indicates A10 GPUs with 24 GB of memory each.

        • 7e: 7 indicates the Ampere architecture.

        • 7s: 7 indicates the Ampere architecture, and s indicates seventh-generation A30 GPUs.

    • <nx>large: is an indicator of the number of vCPUs of the instance type. A larger value of n in<nx> indicates a larger number of vCPUs of the instance type. For example, xlarge indicates 4 vCPUs, 2xlarge indicates 8 vCPUs, and 3xlarge indicates 12 vCPUs.

  • Instance families that support instance type changes: For more information, see Instance types and families that support instance type changes.

  • Available instance types in each region: The available instance families and types vary based on the region. You can go to the Instance Types Available for Each Region page to view the available instance types in each region.

Use scenarios of instance families

Enterprise-level instance families

image

Heterogeneous computing instance families

image

Select instance families based on pre-installed software

Select instance families based on your applications and the selection principles.

Application type

Common application

Selection principle

Recommended instance family

Load balancing

NGINX

Select instance families that support frequent establishment of connections.

  • CPU computing power: high.

  • Amount of memory: moderate.

c8i, c7, c7nex, and g5ne

Remote Procedure Call (RPC)

  • SOFA

  • Dubbo

Select instance families that can provide a large amount of memory for network connection-intensive workloads.

g8a, g7nex, g8i, and g7

Cache

  • Redis

  • Memcache

  • Solo

  • CPU computing power: moderate.

  • Amount of memory: large.

r8i, r8a, r7, and r7a

Configuration center

ZooKeeper

Select instance families that can handle a large number of I/O operations generated when applications initiate negotiations.

  • CPU computing power: moderate.

  • Amount of memory: moderate.

c8a, c7, c8i, and u1

Message queues

  • Kafka

  • RabbitMQ

Cloud disks are preferred for message integrity.

  • CPU computing power: moderate.

  • vCPU-to-memory ratio: 1:1.

  • Storage: moderate.

c8a, c7, c8i, and u1

Container orchestration

Kubernetes

ECS bare metal instances and containers are combined to maximize computing power.

ebmc6e, ebmg6e, ebmc6, ebmg6, ebmc6a, ebmc7a, ebmg6a, and ebmg7a

Large table storage

HBase

  • In most cases, d series instance families are suitable.

  • If your business requires ultra-high IOPS, you can select i series instance families.

d3c, d3s, and i4

Databases

  • MySQL

  • NoSQL

  • If your business requires scalable storage, you can select instance families with enhanced SSDs (ESSDs).

  • If your business is I/O-sensitive, i series instance families are preferred.

g8a, g7, g8i, and i4

SQLServer

  • Windows provides single-channel I/O configuration while high I/O capabilities are required. In this case, instance families with ESSDs are preferred.

  • The logical and physical sectors of ECS instances are set to 4 KB in size.

g8a, g7, r7, r8i, and g8i

Text search

Elasticsearch

  • Select instance types that have high vCPU-to-memory ratios.

  • I/O capabilities can meet the requirements for exporting database data in the .es format.

i4, i4r, i3, and i2

Real-time computing

  • Flink

  • Blink

Select general-purpose instance families and cloud disks based on the storage capacity or select d series instance families.

i4g, i4, and d3c

Offline computing

  • Hadoop

  • HDFS

  • CDH

d series instance families are preferred.

d3s and d3c

Video transcoding

  • Video-on-demand (VOD)

  • Live streaming

  • CPU computing power: high.

  • Amount of memory: moderate.

  • Number of I/O operations: moderate.

c8y

Big data

  • Spark

  • Hive

  • CPU computing power: high.

  • Bandwidth of memory: high.

  • Bandwidth of storage for I/O operations: high.

g8y and r8y

Select instance families based on segmented business scenarios

Instance families that are recommended for general-purpose applications, gaming applications, and live streaming

The scenarios are CPU compute-intensive. We recommend that you select an instance type with a balanced CPU-to-memory ratio such as 1:2, use an ultra disk as the system disk, and use standard SSDs or ESSDs as data disks. For scenarios that require higher network performance such as on-screen video comments, you can select an instance type with higher specifications to improve packet forwarding rates.

Scenario category

Scenario

Recommended instance family

Performance requirement

CPU-to-memory ratio

General-purpose applications

Balanced performance applications and backend applications

g series instance families, such as g7

Medium clock speed, compute-intensive

1:4

Applications with high packet forwarding rates

g series instance families, such as g7

High packet forwarding rate, compute-intensive

1:4

High-performance computing

hfc series instance families, such as hfc7

High clock speed, compute-intensive

1:2

Gaming applications

High-performance client games

hfc series instance families, such as hfc7

High clock speed

1:2

Mobile or web games

g series instance families, such as g6e

Medium clock speed

1:4

Live streaming

Video forwarding

g series instance families, such as g7

Medium clock speed, compute-intensive

1:4

On-screen video comments

g series instance families, such as g7

High packet forwarding rate, compute-intensive

1:4

Recommended instance families for big data scenarios such as Hadoop, Spark, and Kafka

In big data scenarios such as Hadoop, Spark, and Kafka, each node has different performance requirements. You must balance the performance of each node, including the computing performance, storage throughput, and network performance.

  • Management nodes: Select an instance family in the same manner that you select an instance family in general-purpose scenarios. For more information, see Select instance families based on segmented business scenarios.

  • Compute nodes: Select an instance family in the same manner that you select an instance family in general-purpose scenarios. For more information, see the Select instance families based on segmented business scenarios section in this topic. Select instance types based on the cluster size. For example, you can select ecs.g7.4xlarge for a cluster that consists of less than 100 nodes and ecs.g7.8xlarge for a cluster that consists of 100 nodes or more.

  • Cache nodes: are used to store hot data or deploy Really Simple Syndication (RSS) and require high disk and network I/O performance. We recommend that you select the i4g or i2g instance family.

  • Compute and cache nodes: are used for computing and data caching. When you select an instance family, consider the computing performance, I/O performance, and disk capacity. We recommend that you select the i4, i4r, or d3c instance family.

    Note

    Preemptible instances can be used as compute nodes to improve cost-effectiveness. For more information, see What are preemptible instances?

  • Data nodes: require high storage throughput, high network throughput, and balanced CPU-to-memory ratios. We recommend that you use the d series big data instance families. For example, you can select ecs.d2s.5xlarge and ecs.d3s.4xlarge for MapReduce and Hive, and ecs.d2s.10xlarge for Spark and MLib.

Recommended instance families for databases, caches, and search scenarios

In most cases, the scenarios require CPU-to-memory ratios higher than 1:4. Specific software in the scenarios is sensitive to latency and storage I/O capabilities. We recommend that you select instance families whose memory is cost-effective.

Scenario category

Scenario

Recommended instance family

CPU-to-memory ratio

Data disk

Relational databases

High performance and high availability at the application layer

i series instance families

1:4

Local SSDs, ultra disks, and standard SSDs

Small and medium-sized databases

g series instance families, or other instance families that have a CPU-to-memory ratio of 1:4

1:4

Ultra disks and standard SSDs

High-performance databases

i series and r series instance families

1:8

Ultra disks and standard SSDs

Distributed cache

Medium memory usage

g series instance families, or other instance families that have a CPU-to-memory ratio of 1:4

1:4

Ultra disks and standard SSDs

High memory usage

r series and i series instance families

1:8

Ultra disks and standard SSDs

NoSQL databases

High performance and high availability at the application layer

i series instance families

1:4

Local SSDs, ultra disks, and standard SSDs

Small and medium-sized databases

g series instance families, or other instance families that have a CPU-to-memory ratio of 1:4

1:4

Ultra disks and standard SSDs

High-performance databases

i4 and i4r instance families

1:8

Ultra disks, standard SSDs, and local SSDs

Elasticsearch

Small clusters that rely on cloud disks to ensure high data availability

g series instance families, or other instance families that have a CPU-to-memory ratio of 1:4

1:4

Ultra disks and standard SSDs

Large clusters that require high availability

d series instance families

1:4

Local SSDs, ultra disks, and standard SSDs

This section uses databases as an example. Traditionally, business systems directly connect to OLTP databases and data redundancy is implemented by RAIDs. However, you can use Alibaba Cloud ECS to flexibly deploy lightly and heavily loaded databases.

  • Lightly loaded databases: use i4r and i4g instance families with cloud disks, which are more cost-effective.

  • Heavily loaded databases: require high storage IOPS and low read/write latency. We recommend that you use i series instance families equipped with local SSDs. The local SSDs are high I/O Non-Volatile Memory Express (NVMe) SSDs that can meet the requirements of large heavily loaded databases.

数据库选型

Recommended instance families for scenarios such as deep learning and image processing

In the scenarios, applications require high-performance GPU accelerators. We recommend that you use the following GPU-to-CPU ratios in different scenarios:

  • Deep learning training: a GPU-to-CPU ratio in the range of 1:8 to 1:12

  • General-purpose deep learning: a GPU-to-CPU ratio in the range of 1:4 to 1:48

  • Image recognition and inference: a GPU-to-CPU ratio in the range of 1:4 to 1:12

  • Speech recognition and synthesis inference: a GPU-to-CPU ratio in the range of 1:16 to 1:48

The following figure shows the GPU- and FPGA-accelerated instance families recommended for common AI and image or video processing scenarios.GPU选型

Check and adjust your selection

After you create an instance of the selected type and start to use the instance, we recommend that you check whether the instance type is suitable based on the performance monitoring data of the instance.

If you select the ecs.g8i.xlarge instance type to create an instance and find that the CPU utilization of the instance is low, we recommend that you log on to the instance to check whether the memory usage is high. If the memory usage is high, you can change the instance type to an instance type that has a more suitable CPU-to-memory ratio from another instance family. For more information, see the following topics:

For scenarios such as insufficient resources, retirement of instance families, change to a more cost-effective instance family, or instance configuration upgrade, you can modify instance configurations based on instance family features. For more information, see Overview of instance configuration changes and Instance types and families that support instance type changes.