发布于 2026-01-06 8 阅读
0

2024 年云服务提供商对比:虚拟机性能/价格;DEV 全球展示挑战赛,由 Mux 呈现:展示您的项目!

2024年云服务提供商对比:虚拟机性能/价格

由 Mux 主办的 DEV 全球展示挑战赛:展示你的项目!

又到了年度云计算性能对比测试时间。这次测试稍微晚了一些,大部分基准测试工作已于今年初夏完成,一些要点已在六月份的会议上我题为“最大化云端性能和成本效益”的演讲中进行了总结(可以在 YouTube 上观看,获取许多实用技巧)。然而,由于存在一些需要完善的细节,以及夏季期间出现的新情况,所以还是精益求精为好。

目录:

什么是新的

2023 年的对比中,我考察了 10 家供应商的虚拟机类型,而这次的对比则更有针对性,涵盖了7 家供应商30 种虚拟机类型。以下是供应商的变化:

  • IBM被剔除是因为其价值太低,无法与其他公司竞争。
  • OVHCloud令人失望(无论是性能还是支持),因此被另一家受欢迎的廉价服务提供商Hetzner取代。
  • 为了简化比较,阿里云腾讯也被排除在外,因为它们在西方市场并不那么重要。

其他变化:

  • 新 CPU: AMD EPYC Genoa可从 3 家供应商处购买,而Google刚刚开始提供 Intel Emerald Rapids亚马逊则推出了全新的Graviton4
  • 更多测试:我们运行了更多基准测试,并针对不同类型实例在不同区域进行了更长时间的测试,以确定性能稳定性。此外,我们还测试了突发性能实例,但相关结果将在后续报告中单独发布。

参赛者(2024 年版)

与去年类似,我将重点关注2 倍 vCPU实例,因为这是进行有意义比较的最小可扩展单元(通常也是多种虚拟机类型的最小可扩展单元),考虑到大多数AMDIntel实例都使用超线程(也称为对称多线程)。因此,对于这些系统,一个 vCPU 相当于一个超线程,或者说半个核心,而 2 倍 vCPU 实例则相当于一个完整的核心,拥有两个线程。这一点将在可扩展性部分详细说明。

本次对比将更加集中,略过那些明显不具竞争力的实例类型。我仍在尝试配置2GB/vCPU内存(这种配置有时被认为是“计算优化型”,有时被认为是“通用型”)和30GB 的 SSD(非高 IOPS)启动盘,以使价格对比更有意义(例外情况会另行说明)。

按需付费/ *按需付费*的价格包含100%的持续折扣(如有),并且指的是美国或欧洲的低成本地区。对于采用浮动定价的供应商,最便宜的地区几乎总是在美国。

对于提供一年期三年期承诺/预留折扣价的供应商,零首付价格会与该选项一同列出。这些价格有效期至2024年7月,请在最终决定前查询最新价格。

作为参考,以下概述了 AMD、Intel 和 ARM 各代 CPU 的概览,从较旧(上)到较新(下),大致按单核性能等级水平分组,这是基于本次和之前的比较结果:

图片描述

这应该能让你立即对仅基于 CPU 的性能等级有一个大致的了解,但需要注意的是,对于启用了 Hypethreading 的实例,每 2 个 vCPU 对应一个核心。

一般来说,你应该避免使用老旧的CPU,因为它们的效率较低(运行成本较高),云服务提供商实际上会收取更高的费用,却提供更低的性能。为了专注于更相关的产品,我甚至不会提及去年就已经过时、性价比不高的型号。

亚马逊弹性计算云(EC2)

实例类型 CPU类型 CPU GHz/内存/固态硬盘 价格(美元/月) 1年期租金/月 3年期租金/月 现货价格/月
C6a.large (M) AMD Milan 2.65/4/30 58.25 39.34 26.99 28.65
C7g.large (G3) AWS Graviton3 2.1/4/30 55.33 37.29 25.69 24.10
C7i.large (SR) 英特尔蓝宝石 2.4/4/30 67.55 45.50 31.08 30.42
C7a.large (G) AMD 热那亚 2.6/4/30 77.36 51.97 35.39 28.62
R7iz.large (E) 英特尔翡翠® 3.7/16/30 138.18 87.94 58.42 55.35
R8g.large (G4) AWS Graviton4 2.8/16/30 88.41 59.40 39.01 23.01

亚马逊网络服务AWS)几乎可以说是整个“云服务提供商”行业的鼻祖——尽管规模较小的联网虚拟机提供商早在它之前就已出现(例如Linode)——而且至今仍占据市场主导地位。AWS平台提供广泛的服务,但当然,为了便于比较,我们只关注其EC2产品。

自去年以来,已经推出了三款新的CPU。亚马逊自家的Graviton4英特尔的Emerald Rapids最近才发布了内存优化版本(分别为R8gR7iz),所以如果您不需要8GB/vCPU的内存,则需要等待更经济实惠的版本上市。在下面的性价比比较中,预计这两款CPU会处于劣势。另一方面,新款AMD EPYC Genoa已经广泛发布,并推出了内存优化、通用和计算优化版本,我们正在测试的是计算优化版本(C7a)。让我感到惊喜的是,它不支持SMT(如果您愿意,也可以称之为非超线程),这意味着每个vCPU都拥有一个完整的核心。

使用 EC2 实例,您通常可以清楚地知道自己将获得什么(实例类型对应特定的 CPU),但由于支付/预留/预付等方式众多,定价非常复杂,而且价格还会因地区而异(我使用的是美国成本最低的地区)。列出的 1 年/3 年预留价格不包含预付款——如果您预付,价格可以进一步降低一些。竞价型实例的价格差异更大,不仅因地区而异,而且更新频繁(尤其是对于新推出的实例类型),因此您需要密切关注其价格。

谷歌计算引擎(GCE)

实例类型 CPU类型 CPU GHz/内存/固态硬盘 价格(美元/月) 1年期租金/月 3年期租金/月 现货价格/月
n2-2 (I) 英特尔 Ice Lake 2.6/4/30 49.82 39.87 29.34 37.60
n2d-2 (M) AMD Milan 2.45/4/30 43.73 35.08 25.91 12.22
t2d-2 (M) AMD Milan 2.45/8/30 64.68 41.86 30.76 11.77
c3-4/2** (SR) 英特尔蓝宝石 2.7/4/30 65.31 42.03 30.71 17.86
c3d-4/2** (G) AMD 热那亚 2.6/4/30 57.12 36.87 27.02 24.28
n4-2 (E) 英特尔翡翠® 2.1/4/30 60.77 39.18 28.67 25.75
c4-2 (E) 英特尔翡翠® 2.3/4/30 64.49 41.52 30.34 27.23

**推断 2x vCPU 实例类型需要 4x vCPU 最小大小。

歌云平台( GCP ) 与AWS非常接近,提供的服务大体相同,但市场份额略逊一筹(排名第三,位列微软 Azure之后)。GCP计算云产品在可配置性和实例类型方面极具吸引力。然而,正是这种多样性使得选择合适的实例变得更加困难,这也促使我开始对所有可用实例类型进行基准测试。

今年,我们采用了AMD EPYC Genoa解决方案(c3d ),根据我几个月前发布的测试结果,我们目前在SpareRoom公司正在使用该方案。此外,最新的Intel Emerald Rapids n4c4处理器也刚刚上市。

GCP 的价格因地区而异,并且存在一些奇怪的规律。例如,在预订时,每个 vCPU配备一个完整 AMD EPYC核心的t2d实例和每个 vCPU配备一个超线程(即半个核心)的n2d实例,每个 vCPU 的价格相同,但按需购买时n2d实例更便宜。此外,某些类型的实例(例如n2n2d)如果您不进行相应的设置,则会配备较旧(速度较慢)的 CPU,获得性能分别提升 30% 和 20% 的实例,价格却相同。min_cpu_platformAMD MilanIntel Ice Lake

请注意,c3c3d类型的实例最低配置为 4 倍 vCPU。这会影响价格比较,因此我假设配置为 2 倍 vCPU 的价格(CPU/内存成本的一半 + 30GB SSD 的全部成本)。GCP 允许您禁用部分核心(选择“可见”核心),因此,虽然您需要支付最低 4 倍 vCPU 的费用,但您仍然可以在 2 倍 vCPU 实例上运行基准测试,以便进行公平的比较。

Microsoft Azure

实例类型 CPU类型 CPU GHz/内存/固态硬盘 价格(美元/月) 1年期租金/月 3年期租金/月 现货价格/月
D2pls_v5 (A) 安培阿尔特拉 3.0/4/32 52.04 31.65 21.26 7.36
D2ls_v5 (I) 英特尔 Ice Lake 2.8/4/32 64.45 38.98 25.98 17.91
D2as_v5 (M) AMD Milan 2.45/8/32 65.18 39.40 26.26 8.68

Azure是排名第二的云服务提供商,不出所料,它是大多数基于 Microsoft/Windows 的解决方案的最佳选择。此外,它也提供多种类型的 Linux 虚拟机,其功能与AWS / GCP非常相似。

Azure定价至少和AWS / GCP一样复杂,而且定价工具似乎更糟糕。他们在更新产品线方面也落后于其他两大供应商,与去年相比,几乎没有发布任何值得关注的产品,这本应降低他们的竞争力。他们从去年就开始对EPYC Genoa进行评测,最近也启动了Emerald Rapids 的预览,所以明年至少应该会有新机型推出供我们比较!

Oracle 计算虚拟机

实例类型 CPU类型 CPU GHz/内存/固态硬盘 价格(美元/月) 现货价格/月
标准.A1 (A) 安培阿尔特拉 3.0/4/30 19.78 10.53
标准A2(AO) 安培安培一号 3.0/4/30 17.31
标准3(I) 英特尔 Ice Lake 2.6/4/30 37.75 20.96
标准.E4 (M) AMD Milan 2.45/4/30 23.88 12.57
标准.E5 (G) AMD 热那亚 2.6/4/30 28.99 15.12

去年我最大的惊喜是Oracle云基础设施OCI)。这真是一个令人惊喜的发现。Oracle不仅提供了迄今为止最慷慨的免费套餐(A1型ARM虚拟机的免费额度相当于4倍vCPU、24GB内存和200GB磁盘空间,永久免费),而且他们的付费ARM实例在所有供应商中性价比最高——尤其是在按需使用方面。这些免费资源足以满足相当多的业余项目需求——而同样的资源在三大云服务提供商那里每月至少要花费100美元。

请注意,注册流程较为严格,旨在防止滥用。请确保您未使用 VPN,并且注册邮箱地址中不要包含任何与Oracle 相关的字样。您将获得一个“免费”账户,该账户仅允许您访问有限的服务。除了免费套餐涵盖的A1虚拟机之外,您很难使用初始赠送的免费额度构建其他类型的虚拟机。

升级到常规付费账户(仍可享受免费额度),即可获得一系列虚拟机选择。今年新增了基于EPYC Genoa Standard.E5 的虚拟机以及采用AmpereOne CPU 的第二代 ARM Standard.A2虚拟机。A1 的价格略有上涨,而A2则更便宜。如果您期望 Ampere 的这款新 CPU 比Altra快得多,可能会感到失望。它的单核功耗可能更低,这或许可以解释 Oracle 将其定价更低的原因,但其性能表现参差不齐,在某些任务中速度快得多,而在另一些任务中则慢得多。

Oracle Cloud 的价格在所有地区都一样,这一点很不错。他们不提供任何特定区域的折扣,但对抢占式(竞价型)实例提供 50% 的折扣。

Akamai(Linode)

实例类型 CPU类型 CPU GHz/内存/固态硬盘 价格(美元/月)
Linode 4 (R*) AMD 罗马 2.9/4/80 24.00
Linode 4 (M*) AMD Milan 2.0/4/80 24.00
高级 4G (M) AMD Milan 2.0/4/80 36.00

*共享核心。

历史悠久的云服务提供商Linode(比 AWS 早几年成立)现已成为Akamai的一部分超过 2 年。

他们似乎一直在更新数据中心。正如我们前几年看到的,创建虚拟机时分配到哪种 AMD CPU 完全取决于运气,但现在通常几乎总能分配到MilanRome。有趣的是,虽然去年所有Milan实例的速度都比Rome慢,但今年我发现它们的性能经常要好得多。这并非超额分配或“嘈杂邻居”问题,性能差异显著的Milan实例在数小时/数天的测试中都能保持稳定的性能水平。看来它们在不同的数据中心配置有所不同。

令人有点恼火的是,除非选择更昂贵的专用虚拟机,否则在创建虚拟机后如果不进行测试,就无法确定预期性能。但除此之外,Akamai/Linode 仍然易于设置和维护,并且在各个地区都有固定、简单的定价。

DigitalOcean Droplets

实例类型 CPU类型 CPU GHz/内存/固态硬盘 价格(美元/月)
基础-2 * 英特尔 2.5/4/80 24.00
Prem2-AMD (R*) AMD 罗马 2.0/4/80 32.00
Prem2-Intel (C*) 英特尔 Cascade L 2.5/4/100 28.00
CPU2-Opt(S) 英特尔 Skylake 2.7/4/25 42.00

*共享核心。

两年前, DigitalOcean在性价比方面名列前茅,其共享 CPU基础版“Droplets”提供了极高的性价比。我目前就使用 DigitalOcean 的 Droplets 来托管一个名为7Timer的免费天气服务,如果您使用我的推广链接注册,即可获得 200 美元的免费额度——如果您在免费期结束后继续使用该服务,您的支持将有助于支付该免费项目的托管费用。除了性价比之外,我选择 DigitalOcean 的另一个原因是它设置、部署、快照和备份都非常简便。

然而,他们性价比最高的(共享CPU)虚拟机的性能连续第二年进一步下降,这表明他们存在严重的超额认购现象。虽然我喜欢他们简单、不受地域限制且稳定的定价结构,但从前面提到的性能下降以及没有更新CPU的迹象来看,他们似乎已经停止更新虚拟机集群了。

赫茨纳

实例类型 CPU类型 CPU GHz/内存/固态硬盘 价格(美元/月)
CX22 (S*) 英特尔 Skylake 2.2/4/40 4.91
CAX11 (A*) 安培阿尔特拉 2.0/4/40 4.91
CPX31/2** (R*) AMD 罗马 2.44/4/80 8.81
CCX13(M) AMD Milan 2.4/8/80 15.54

*共享核心。
**推断 2 倍 vCPU 实例类型需要至少 4 倍 vCPU 大小。

Hetzner是一家历史悠久的德国数据中心运营商和网络托管商,提供价格非常实惠的公有云服务。我之前没用过他们的服务,但他们经常被推荐为可靠的低成本解决方案,所以我决定替换掉去年让我非常失望的廉价运营商OVH,OVH的性能和支持都让我很不满意。

表面上看,他们的价格似乎只是大型供应商价格的一小部分,所以我进行了数天的长时间基准测试,以确保没有明显的超额认购——尤其是共享核心类型的实例。只有CCX13声称提供专用核心。讽刺的是,这些专用实例的性能会因创建它们的数据中心的不同而出现显著差异。因此,虽然共享核心虚拟机的性能可能不稳定,但其波动通常小于不同区域专用虚拟机的性能波动。

测试设置和基准测试方法

方法与过去两年大致相同,但一些基准测试有所变化。几乎所有实例都运行在 64 位Debian 12 系统上,不过有几个实例我不得不使用Ubuntu 24.04,而且 Oracle 的 ARM 芯片仅兼容Oracle Linux。初始设置如下:

# Debian
sudo apt-get update
sudo apt install -y wget build-essential cpanminus libxml-simple-perl libjpeg-dev libexpat1-dev zlib1g-dev libssl-dev libdb-dev php-cli php-xml php-zip libelf-dev

# Ubuntu
sudo yum update
sudo yum install -y wget make automake gcc gcc-c++ kernel-devel perl-App-cpanminus perl-XML-Simple libjpeg-devel expat-devel zlib-devel openssl-devel libdb-devel php-cli php-xml php-pecl-zip elfutils-libelf-devel screen
Enter fullscreen mode Exit fullscreen mode
  • Perl 5.36 编译(perlbrew)

随后,通过 perlbrew 从源代码安装了一个特定的 Perl 版本(无测试,双线程),既作为编译基准,也作为基于 Perl 的测试套件的通用比较基础:

\curl -L https://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew download perl-5.36.0
time perlbrew install perl-5.36.0 -n -j2
Enter fullscreen mode Exit fullscreen mode

可选:为了方便以后在终端上使用 perlbrew,您可以将其添加到您的配置文件中。

echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc
Enter fullscreen mode Exit fullscreen mode
  • 基准测试::DKbench

和以前一样,我使用我自己的基准测试套件,现在它已经过改进,并在 CPAN 上以Benchmark::DKbench 的形式发布。它已被证明能够很好地近似我们所用工作负载类型的实际性能差异,并且也能够很好地比较单线程和多线程性能(如果需要,可以扩展到数百个线程)。

为了进行设置,我们激活刚刚编译的 Perl,并添加cpanm模块安装程序,我们使用该安装程序来获取 DKbench(以及 BioPerl 以启用可选的基准测试):

perlbrew switch perl-5.36.0 
perlbrew install-cpanm
cpanm -n BioPerl Benchmark::DKbench
Enter fullscreen mode Exit fullscreen mode

此时,为了确保每个实例都安装了相同的 Perl 库(否则这是可选的),我们运行以下命令:

setup_dkbench --force
Enter fullscreen mode Exit fullscreen mode

运行测试至少 10 次迭代(它将在单线程和多线程模式下运行,并显示扩展性):

dkbench -i 10
Enter fullscreen mode Exit fullscreen mode

我创建了多个实例,最好是在不同的区域,如果我发现存在显著差异,我会运行基准测试 24 小时或更长时间。

  • Geekbench 5

我保留了 Geekbench,一方面是因为它可以帮助你比较往年的测试结果,另一方面是因为 Geekbench 6 似乎差了很多——尤其是在多线程测试方面(我甚至可以说它看起来像是坏掉了):

# x86
wget https://cdn.geekbench.com/Geekbench-5.4.4-Linux.tar.gz
tar xvfz Geekbench-5.4.4-Linux.tar.gz
Geekbench-5.4.4-Linux/geekbench5

# ARM64
wget https://cdn.geekbench.com/Geekbench-5.4.0-LinuxARMPreview.tar.gz
tar xvfz Geekbench-5.4.0-LinuxARMPreview.tar.gz
Geekbench-5.4.0-LinuxARMPreview/geekbench5
Enter fullscreen mode Exit fullscreen mode

我只保留了两次运行中最好的结果,你可以在这里浏览结果。还有一个 Arm 版本,网址是https://cdn.geekbench.com/Geekbench-5.4.0-LinuxARMPreview.tar.gz

  • Phoronix(openbenchmarking.org)

我第一次添加了一些 Phoronix 基准测试。主要是因为,除了流行之外,它们还可以帮助测试一些特定方面(例如 AVX512 扩展),而且结果也是公开的

安装该套件:

wget https://phoronix-test-suite.com/releases/phoronix-test-suite-10.8.4.tar.gz
tar xvfz phoronix-test-suite-10.8.4.tar.gz
cd phoronix-test-suite
sudo ./install-sh
Enter fullscreen mode Exit fullscreen mode

然后我们安装/运行这些基准测试:

-- 7-zip

phoronix-test-suite benchmark compress-7zip
Enter fullscreen mode Exit fullscreen mode

非常常见的应用和非常常见的基准测试——记录平均压缩/解压缩分数。

-- OpenSSL(RSA 4096 位)

phoronix-test-suite benchmark openssl
Enter fullscreen mode Exit fullscreen mode

选择选项 1。此基准测试使用 SSE/AVX 指令集,最高支持 AVX512,这对某些用户来说可能很重要。缺少最新扩展指令集的旧款 CPU 会处于劣势。

-- Linux 内核编译

phoronix-test-suite benchmark build-linux-kernel
Enter fullscreen mode Exit fullscreen mode

选择选项 1。仅比较了 x86 CPU,因为不同架构的工作负载并不相同。

结果

您可以在此电子表格中查看原始结果(或点击此处查看完整的 Geekbench 结果)。

在以下图表中,y 轴列出了实例名称,括号内为 CPU 类型:

(E)  = Intel Emerald Rapids
(SR) = Intel Sapphire Rapids
(I)  = Intel Ice Lake/Cooper Lake
(C)  = Intel Cascade Lake
(S)  = Intel Skylake
(G)  = AMD Genoa
(M)  = AMD Milan
(R)  = AMD Rome
(G4) = Amazon Graviton4
(G3) = Amazon Graviton3
(G2) = Amazon Graviton2
(A1) = Ampere AmpereOne
(A)  = Ampere Altra
     = Unspecified Intel (Broadwell/Skylake)
Enter fullscreen mode Exit fullscreen mode

单线程性能

单线程性能对许多工作负载至关重要。如果您的任务高度可并行化,您可以向部署中添加更多虚拟 CPU (vCPU),但对于许多常见类型的任务而言,这并非总是解决方案。例如,Web 服务器可以扩展以并行处理任意数量的请求,但 vCPU 的线程速度决定了每个请求的最小响应时间。

  • DKbench 2.8 单线程

我们首先使用最新的 DKbench,运行 19 个默认基准测试(Perl 和 C/XS),这些测试涵盖各种常见的服务器工作负载,首先在单线程上进行测试:

图片描述

谷歌新推出的 Intel Emerald Rapids c4实例性能领先,亚马逊甲骨文谷歌的AMD EPYC Genoa紧随其后。需要注意的是,Emerald Rapids并非在所有方面都更快(稍后我们将看到更多基准测试结果——DKbench 测试对其优势最为明显),而且在没有最新 Intel 驱动程序的旧版操作系统镜像上可能会出现性能问题。例如,在 CentOS 7 Apache 服务器上运行相同的基准测试,在Emerald Rapids上的速度会更慢。

虽然亚马逊的 Genoa在这项测试中比谷歌的Genoa 更快,但正如在首次测试谷歌的 c3d时所指出的那样,如果您为实例分配一个完整的处理器(180x vCPU),则可以获得大约 10% 的额外速度提升。

更令我惊讶的是,亚马逊自家的Graviton4单核性能几乎达到了英特尔/AMD 顶级处理器的水平!考虑到Graviton ARM CPU 的设计目标是在不具备超线程技术的情况下实现高能效和低虚拟 CPU 价格,单线程性能原本被认为是其弱点。一旦通用版和计算优化版在 AWS 上推出,我相信它们会迅速成为爆款。

另一款新的ARM CPU AmpereOne性能表现平平,从其市场定位来看,它似乎也并非以性能取胜——重点在于价格;在一些基准测试中,它的性能甚至不如老款Altra。不过,它在DKbench综合性能测试中胜出,而且价格更低。

最后,在低成本服务商中,DigitalOcean 的性能表现落后,这表明他们的服务器集群需要升级。AkamaiHetzner提供一些速度很快的Milan实例,但这两家服务商都无法保证创建实例时的性能水平——图表中显示了性能波动。这并非超额认购,性能本身是稳定的,只是服务器组的配置方式不同。

Geekbench 的测试结果也相差不大:

图片描述

多线程性能和可扩展性

  • 可扩展性

DKbench 会以单线程和多线程模式运行基准测试套件(本次对比使用 2 个线程,因为我们使用了 2 个 vCPU 实例),并计算可扩展性百分比。该基准测试显然使用了高度并行化的工作负载(如果您运行的并非此类工作负载,则需要更多地依赖单线程基准测试)。在下图中,100% 可扩展性意味着,如果您运行 2 个并行线程,它们的运行速度将与单独运行的速度相差 100%。对于每个 vCPU 都是 1 个核心的系统(例如所有 ARM 系统),或者对于每个 vCPU 都是共享线程池中的一个线程的“共享”CPU 系统,您应该预期可扩展性接近 100%——对于纯 CPU 工作负载,一个 vCPU 上运行的程序不应影响另一个 vCPU。

大多数 Intel/AMD 系统都采用单核双线程(Intel 称之为超线程/HT,或者如果您喜欢,也可以称之为对称多线程/SMT)作为双 vCPU 单元。这种配置的可扩展性远低于 100%。50% 的可扩展性相当于只有 1 个 vCPU,这是无法接受的。因此,可扩展性越高(高于 50%),双 vCPU 带来的性能提升就越大。

图片描述

正如预期,ARM 和共享 CPU 的性能接近 100%,也就是说,从 1 个 vCPU 升级到 2 个 vCPU,多线程性能翻了一番。x86 架构的两款处理器也达到了这一水平:亚马逊的 Genoa C7a和谷歌较早的Milan t2d也加入了这一行列

从其他方面来看,AMD 一如既往地在超线程技术上优于英特尔,始终能够实现超过 60% 的性能扩展。至少英特尔最新的处理器没有像两代前的Ice Lake那样糟糕,后者勉强超过 50%。如果你关注科技新闻,就会知道英特尔已经宣布将在未来的产品中放弃超线程技术,原因显而易见——它占用芯片面积,而且英特尔一直未能从中获得任何显著的性能提升。

请注意,去年我选择了一个特定的、高度可扩展的基准来计算最大可扩展性,而今年我采用了所有基准的平均值——因此数值较低。

  • 多线程性能

从单线程性能和可扩展性结果我们可以推测 DKbench 多线程运行的结果,但无论如何,结果如下:

图片描述

亚马逊凭借搭载Genoa处理器的C7a荣登榜首而去年冠军Milan t2d则跌至第三,表现不俗的Graviton4 R8g位列其后。榜首之位在意料之中,Genoa在单线程性能方面一直处于领先地位,而C7a则为每个虚拟 CPU 提供了一个完整的核心。

Graviton3紧随其后,之后依次是Emerald RapidsGenoaAmpereMilan,大致按此顺序排列。Ice Lake垫底,部分原因是其糟糕的52%可扩展性。

Geekbench 5 的测试结果总体上也认同这一点:

图片描述

接下来是另一个常用的基准测试工具——7zip:

图片描述

Graviton4在这项测试中名列榜首,Genoa和Graviton3紧随其后。我知道 AMD 在 7zip 基准测试中通常比 Intel 表现更好,但我没想到Graviton4的表现会如此出色。Emerald Rapids相比 Intel 的上一代产品有了显著提升,但至少在解压缩方面,仍然落后于最新的竞争对手。

我准备了几个对开发者友好的基准测试:从源代码编译 Perl 5.36 和 Linux 内核:

图片描述

图片描述

这里有两个明显的“赢家”:亚马逊的 C7a,每个 vCPU 提供一个完整的Genoa核心;以及价格极其低廉的基于Rome架构的Hetzner CPX31Akamai 的 Rome Linode 紧随其后)。Graviton4在 Perl 编译方面再次表现出色,尽管由于架构依赖性我没有将 ARM 架构从 Linux 内核测试结果中排除,以免造成不公平的比较。

  • AVX512

最后,如果您有可以利用 AVX512 加速的软件,我这里提供了一个 OpenSSL RSA4096 基准测试。AVX512 是英特尔的扩展指令集,因此自Skylake 架构以来,所有英特尔 CPU 都支持该指令集,而Genoa是首款实现该指令集的 AMD CPU。较旧的 AMD CPU 和 ARM 架构在此基准测试中会处于劣势。

图片描述

令人印象深刻的是,AMD 在英特尔的主场表现优于英特尔,Genoa更是占据绝对榜首,尽管排行榜上半部分主要由英特尔主导,因为他们的大多数 CPU 都支持 AVX512。

性能/价格(按需/即用即付)

比性能本身更重要的一个因素往往是性价比。

我将首先列出所有供应商提供的“按需”价格(包括任何持续使用折扣)。虽然我之前列出了月费,但这些价格实际上是按分钟或小时计费的,所以无需预订整月。

  • DKbench 单线程性能/价格

第一张图表显示的是单线程性能/价格。

图片描述

Hetzner 的服务完全是另一个档次,尤其是在共享 CPU 虚拟机方面。值得一提的是,经过数天甚至数周的基准测试,我没有遇到任何问题——无论是性能方面还是其他方面。考虑到其极低的价格,他们的服务似乎并没有像人们预期的那样供不应求。不过,与大型服务商不同的是,即使是同类型的虚拟机,根据你购买的区块不同,性能也会有所差异(我猜这和AkamaiDigitalOcean 的情况类似)。

除了Oracle之外其他厂商中表现最佳。去年备受好评的A1产品价格上涨,因此AmpereOne A2目前领先,Genoa E5紧随其后。Akamai在性价比方面颇具竞争力,而谷歌则凭借Emerald RapidsGenoaMilan系列产品位列“三大巨头”之首

正如我上面提到的,微软在产品更新方面一直落后,这也是他们今年竞争力最弱的原因。但至少他们的新产品很快就会面世。

  • DKbench 多线程性能/价格

接下来,我们使用双核处理器来评判多线程性能:

图片描述

结果非常相似,只是 ARM 实例受益于其两倍的物理核心数。此外,性能卓越的Amazon C7a比亚马逊自家的Graviton3以及三大主流供应商的任何产品都更具性价比。

Oracle A2 的性能与Hetzner 的专用 CPU 类型相近,但后者的共享虚拟机仍然独占鳌头。

从可扩展性图表中可以预见,由于超线程 (HT) 性能较差,采用英特尔处理器的处理器在排名中下降了几位。

我们也可以用 Geekbench 做同样的事情:

图片描述

虽然图表非常相似,但微软的表现更糟糕。

性能/价格(一年保留期)

三大(也是最贵的)服务商提供大幅的一年期预留折扣。要获得最大折扣,您必须锁定特定的虚拟机类型,因此了解每种类型的具体优惠至关重要。此外,对于AWS ,您可以使用DoIT 的 Flexsave等第三方服务,将一年期价格应用于大多数按需实例,因此即使您不打算预留实例,这部分内容仍然可能对您有用。

  • DKbench 单线程性能/价格

第一张图表仍然是单线程性能/价格。

图片描述

1 年的折扣足以让GCP c4c3d至少在价值上达到 x86 LinodeOCI类型。

  • DKbench 多线程性能/价格

接下来,我们使用 2 个虚拟 CPU 来评估多线程性能:

图片描述

非超线程虚拟机方面,AWS C7gC7a位列三大云平台之首,GCP 的 t2d紧随其后。请记住,您可以通过第三方平台在AWS上获得类似的定价,无需预订。

Linode和基于 ARM 的Oracle VM 仍然提供明显更好的价值(而 Hetzner 仍然遥遥领先)。

Geekbench 的测试结果也十分相似:

图片描述

性能/价格(三年保留价)

  • DKbench 单线程性能/价格

最后,对于非常长期的承诺,AWSGCPAzure提供 3 年的预留折扣:

图片描述

谷歌最终超越了甲骨文Akamai。事实上,AWS甚至Azure也有一些服务类型比Akamai和甲骨文的部分服务更具性价比

  • 多线程性能/价格

图片描述

图片描述

性能/价格(竞价型/抢占式虚拟机)

大型云服务提供商(AWSGCPAzureOCI)会以通常非常优惠的价格提供闲置的虚拟机容量,前提是其他客户可以在需要时随时收回这些实例。这种“竞价型”或“抢占式”虚拟机实例定价模式是目前为止为云平台添加计算资源最具成本效益的方式。当然,它并非适用于所有用例,但如果您拥有容错能力强的工作负载,或者能够优雅地中断处理并重建服务器以继续运行,那么这种模式可能非常适合您。

AWS and OCI will give you a 2-minute warning before your instance is terminated. Azure and GCP will give you 30 seconds, which should still be enough for many use cases (e.g. web servers, batch processing etc).

The discount for Oracle's instances is fixed at 50%, but varies wildly for the other providers per region and can change often, so you have to be on top of it to adjust you instance types accordingly.

For a longer discussion on spot instances see last year's spot performance/price comparison. Then you can look at this year's results below.

  • DKbench single-thread performance/price

图片描述

Azure had the most generous discounts, enough to bring it at the perf/price level of budget provider Hetzner's cheapest shared-CPU VMs. GCP was also very generous, especially with the Milan types at the time of testing, surpassing, along with Oracle's AMD types, the dedicated CPU type from Hetzner.

As noted in last year’s analysis, Amazon is less generous with discounts overall, but taking advantage of spot pricing is still the optimal approach for AWS users. I will note here that the best value is offered by the Graviton4 R8g, which provides 4x the RAM compared to the competition. This tells me that when general or compute-optimized Graviton4 types become available, they will be seriously competitive.

  • Multi-thread performance/price

图片描述

图片描述

All VMs that don't give you just a HyperThread per vCPU show up higher in the multi-thread charts, like Azure's ARM instance which tops everything apart from Hetzner's shared CPU. Google's t2d is almost as good value (and faster overall) if you prefer x86. Despite Amazon's lesser discounts, its most interesting VM types are non HT so they don't fall far behind: it's the aforementioned AWS R8g which gives some of the best perf/price ratios if you would like 4x the RAM, while the C7a provides good value while delivering top per-thread performance, thanks to the EPYC Genoa.

Conclusions

As always, I provide all the data so you can draw your own conclusions. If you have highly specialized workloads, you may want to rely less on my benchmarks. However, for most users doing general computing, web services, etc. I'd say you are getting a good idea about what to expect from each VM type. In any case, I'll share my own conclusions, some reasonably objective, others perhaps more subjective.

What's new this year

Let’s begin with what’s new or surprising compared to last year:

  • Hetzner is impressively cheap, especially for their shared-CPU instances. Although you don't get a dedicated CPU like those from the four major providers, each VM was still reasonably stable in performance, and the prices remain much lower than shared-CPU types from either Akamai or DigitalOcean. I still use DigitalOcean myself for the reliability, as in almost a decade of running servers I've never had a single issue occur. However, they really need to upgrade their data centers. If you're looking for the most cost-effective solution possible, I would suggest trying out Hetzner.
  • Some impressive new CPUs appeared. AMD Genoa is available for almost a year now and was indeed a good step up from anything available, until the Emerald Rapids was released recently. This is the first time in years I've seen Intel come this close to AMD in terms of performance and performance/price, which is good news. The Intel/AMD dominance might soon be challenged by ARM designs, which are catching up in per-thread performance. Amazon's Graviton4 is impressive and Google is preparing their own Axion (I can't yet comment on it, as it's in private preview).
  • Oracle continues to impress as it did last year, so that’s no surprise. I was a bit surprised though in that the new AmperOne A2 VMs are not overall faster than the old A1, but they are priced lower so they are going for value. Their free tier remains unbeatable.

General Tips

  • Upgrade to the latest CPU types when possible. Older VMs are slower and tend to be more expensive due to higher operational costs.
  • Plan your usage and consider making reservations (3-year preferred) to lower costs where applicable. Remember, you can get free 1y reservation prices through 3rd parties in AWS.
  • Leverage spot VMs as much as possible. They are essentially the only way the cloud can compete with the cost of buying and running your own servers. Check prices periodically and across all regions that interest you to find the best deals.
  • Remember that vCPUs are not always comparable: ARM systems and very few x86 systems like AWS's C7a and GCP's t2d, provide a full CPU core per vCPU. Most others give you a full core per 2x vCPUs.

Caveats for AMD vs Intel vs ARM

These benchmarks were mostly conducted for generic, parallelizable workloads. There are scenarios though where specific CPUs may exhibit lower than expected performance:

  • Intel Emerald Rapids seemed to be as good or even a bit better than Genoa - especially on DKbench. However, it showed up to 20% lower performance when running on older Apache web server images (Centos 7) in production. I suspect the issue lies with generic CPU drivers in the older OS. However, Emerald Rapids was a bit behind in other benchmarks as well, so I would still probably trust Genoa more for performance consistency if I could not benchmark the specific workload I intended to run.

  • AMD EPYC scales slightly better than Intel, as shown by its superior SMT / Hyper-Threading. However, these AMD CPUs are made of clusters of 8 cores, each cluster having its own cache. The effect is that when using more than 8 cores, some software (e.g. Database servers) will want cores on different clusters to communicate (this is done via AMD's "Infinity Fabric"), which may affect performance.

  • ARM CPUs may be slower at specific tasks for which the x86 compilation offers acceleration through special instructions (AVX etc).

Recommendations per use-case

I'll further comment with my picks for various usage scenarios:

  • Budget solution: Hetzner shared-CPU (preferably the ARM or AMD-powered) seem to offer the best value by quite a margin, assuming you can't use spot instances (in which case Azure's ARM or AMD Milan, or Google's t2d might be good).
  • Best overall value (performance/price) for non-shared CPU: If you can't use spot instances (which would be the best otherwise), look at Oracle's A1 and A2. In fact, if you have a small project, Oracle's free 4x vCPU A1 might be for you (either serving your entire project for free, or as a 50% discount on an 8x vCPU instance etc). If reservations are an option, the AWS C7a and C7g, along with the GCP t2d, are great for multi-threaded workloads.
  • Best value for top-tier performance: If you can reserve for at least 1 year, that would be Google's t2d. For on-demand pricing, Oracle's Standard3 is probably your best bet, unless the slightly lower performance of Amazon's C7g is enough.
  • Maximum performance: Assuming you don't care about price, Google's Emerald Rapids c4 does technically narrowly beat Google's Genoa c4d and Amazon's Genoa C7a in the single-threaded DKbench. However, I listed some caveats (situations both in production and benchmarks where Emerald Rapids falls behind), which would make me trust the Genoa solutions unless I specifically benchmarked my workloads. In addition, if you are looking at multi-threaded performance you'd need twice the c4 vCPUs to keep up with Amazon's non-SMT Genoa solution which for me makes the AWS C7a the overall performance leader.

Summary per cloud provider

Finally, I'll make some comments per provider tested in the order I introduced them:

  • Amazon: Loved their Graviton3 last year, love their new Graviton4 even more. It's the first ARM I've seen in the wild that delivers Apple Silicon level performance - pretty much catching up with AMD/Intel's latest. It is still not available in many types, so if you don't need the memory-optimized R8g, it will soon appear in better suited types. I also liked their new C7a Genoa non-SMT instance, which is at the same time their fastest and a great value. Traditionally, AWS isn't as competitive in x86 pricing, but the C7a outperforms most Azure and GCP offerings. YIt's best to avoid On-Demand pricing where possible. Your best bet is using spot instances; otherwise, consider reservations for long-running instances or services like Flexsave.
  • Google: The Milan-powered t2d is still the best deal for multi-threaded workloads. However, you now have better options if you are after faster per-thread performance, with either c3d or c4. You should be reserving instances for lower prices, but if you are going with on-demand and prefer lower price than top performance, the n2d is still a great choice, as long as you set min_cpu_platform="AMD Milan" when provisioning it. However, the best value by far comes from spot instances, though you'll need to check what's available in your preferred regions at the time.
  • Microsoft: They have not released anything new since last year (although new several types are expected in Q4), which means they have fallen in performance and value compared to the other players. They are still price-competitive for spot instances as they offer some of the biggest discounts.
  • Oracle: I definitely recommend Oracle for whoever has small projects where a 4-core ARM VM, which Oracle provides for free, covers most of the requirements. Their non-free instances are also very competitive, with their on-demand prices comparable to 1-3 year reservation prices from the "Big 3" (Oracle doesn't do reservation discounts), with the best value being the AmpereOne A2 and Genoa E5 for ARM/x86 respectively. Last year I had trouble provisioning non-A1 instances, but that was because I had not been able to upgrade to a paid account (my email contained oracle which sort of "broke" their system). The free account does come with an initial spending amount, but the account itself is very limited as to what VMs it can provision. A regular paid account seems to have no issues.
  • Akamai: It is a shame each VM of the same "type" you create can come at a significantly different level of performance (for both shared and dedicated CPU VMs). The CPU varies, it can be an AMD EPYC from 3 different generations, so upon creating a VM you have to check the CPU type (e.g. cat /proc/cpuinfo on Linux), with the 4-digit model showing the generation on the last digit. I think the ancient Naples are gone now, but if you happen across a 1, expect it to be very slow. On the other hand, 2 always signifies a fast Rome while 3 indicates a Milan which, depending on the data center or rack, can be either faster or slower than Rome. So you'd have to benchmark if you wanted to see how fast your VM is. After creating it, the performance is reasonably stable, even for the shared-CPU Linode types so you can tell the provider is not over-subscribed). I would not actually bother with the pricier dedicate-CPU types, given how good the shared-CPU ones are.
  • DigitalOcean: Although they still provide decent value, they have fallen quite behind Akamai, as there have not been any upgrades. In fact, there is quite a bit of over-subscribing so performance drops lower than usual. I still use their Basic and Premium instances for projects due to the history of reliability I've had with them, but if I want faster servers I have to look elsewhere, which is a shame. As with the other lower cost providers, you do not know exactly what performance level a VM will have until you provision it and benchmark it.
  • Hetzner:我对那些价格极低的云服务提供商一直抱有怀疑,但由于很多Hetzner用户都推荐他们,所以我决定试一试。他们的口碑似乎相当不错——我看到的网上投诉大多是用户被封禁,而且通常都有合理的理由。他们的价格低得令人难以置信——我怀疑他们超额交付了太多资源。不过,即便如此,我也没能察觉到,虚拟机似乎能以相当稳定的性能运行数小时甚至数天。需要注意的是,选择虚拟机类型时,你无法确定实际性能,我尝试的专用CPU类型的性能波动最大(超过30%)。总的来说,ARM CAX*类型的性价比最高,而Rome CPX*类型则是x86架构中最有趣的。

最后,请记住,选择云服务提供商需要考虑网络成本、价格波动、区域要求、内存、存储空间以及其他因提供商而异的因素。此比较仅能帮助您做出部分决策。

文章来源:https://dev.to/dkechag/cloud-provider-comparison-2024-vm-performance-price-3h4l