828华为云征文 | Flexus X实例CPU、内存及磁盘性能实测与分析

引言

随着云计算的普及,企业对于云资源的需求日益增加,而选择一款性能强劲、稳定性高的云实例成为了关键。华为云Flexus X实例作为华为云最新推出的高性能实例,旨在为用户提供更强的计算能力和更高的网络带宽支持。最近华为云828 B2B企业节正在举办,Flexus X实例的促销也非常给力,大家可以去看看。为了帮助用户更好地了解其性能表现,我们通过一系列详尽的测试,对Flexus X实例的各项性能进行了全面评测,包括CPU性能、内存性能、磁盘I/O性能以及网络性能。

本文的目的是通过实测数据来分析Flexus X实例的表现,以帮助用户在选择云服务时做出更明智的决策。

1. 测试环境与方法介绍

为了确保评测结果的准确性与公正性,我们在标准化的环境下进行了多次性能测试。以下是测试环境的配置以及所使用的工具和参数介绍。

1.1 测试工具选择

在云实例性能评测中,选择合适的测试工具至关重要。本次评测中,我们使用了开源的多线程性能测试工具 **sysbench**。sysbench 是一款广泛用于评估系统、数据库和硬件性能的工具,支持多种测试模式,如 CPU、内存、磁盘 I/O 以及数据库基准测试。凭借其灵活性和易用性,sysbench 能够帮助用户快速识别性能瓶颈并优化系统效率,是系统管理员和开发者的理想选择。

1.2 测试参数设置

为了确保结果的客观性,我们在测试中使用了统一的参数配置。具体包括:

  • CPU测试:采用 sysbench 的"cpu"模块,执行固定数量的计算任务,以评估多核的计算能力。
  • 内存测试:使用 sysbench 的"memory"模块,通过大量的内存读写操作测试内存的吞吐量。
  • 磁盘I/O测试:使用 sysbench 进行顺序读写和随机读写测试,评估磁盘的响应速度和吞吐能力。

2. sysbench的安装

2.1 安装文件下载

可以采用以下命令获取安装文件

wget https://github.com/akopytov/sysbench/archive/refs/tags/1.0.20.tar.gz

不过由于网络限制,直接用wget命令下载没有成功。

于是采用先下载到本地,然后上传到服务器的方法。

在github上下载sysbench-1.0.20.tar.gz文件,再使用XFTP上传到服务器/usr/local/sysbench目录。

执行解压命令

tar -zxf sysbench-1.0.20.tar.gz

2.2 构建安装编译

构建sysbench的时候,碰到了问题,主要是缺少了依赖,也就Euler系统默认没有安装相关依赖,需要手动安装一下。

依赖1:automake

[root@flexusx-e724 sysbench-1.0.20]# ./autogen.sh

automake 1.10.x (aclocal) wasn't found, exiting
yum install automake

依赖2:libtool

[root@flexusx-e724 sysbench-1.0.20]# ./autogen.sh

libtoolize 1.4+ wasn't found, exiting
yum install libtool

./autogen.sh

由于本次测试不涉及到数据库的测试,而sysbench默认需要服务器,使用./configure默认安装就会报错。

ERROR: cannot find MySQL libraries. If you want to compile with MySQL support,

please install the package containing MySQL client libraries and headers.

On Debian-based systems the package name is libmysqlclient-dev.

On RedHat-based systems, it is mysql-devel.

If you have those libraries installed in non-standard locations,

you must either specify file locations explicitly using

--with-mysql-includes and --with-mysql-libs options, or make sure path to

mysql_config is listed in your PATH environment variable. If you want to

disable MySQL support, use --without-mysql option.

需要增加配置参数,--without-mysql,不安装对mysql数据库的支持。

./configure --without-mysql

后面再进行make编译

make -j

make install

这样就完成了对sysbench的安装。

[root@flexusx-e724 sysbench-1.0.20]# sysbench

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Reading the script from the standard input:

3. CPU性能评测

在云计算中,CPU性能直接影响到计算密集型任务的执行效率。Flexus X实例配备了最新一代的处理器,具备较高的主频和多核支持。我们通过sysbench的cpu模块对其进行了测试,针对多核的计算能力进行了测评。

评测命令

sysbench --threads=4 --time=60 --report-interval=5 cpu run

上述命令用于运行 sysbench 的 CPU 性能测试,并指定了多个参数:

  • --threads=4:设置线程数为 4,即同时使用 4 个线程进行测试,模拟多线程的运行环境。
  • --time=60:测试持续时间为 60 秒。
  • --report-interval=5:每 5 秒输出一次测试报告,显示当前的性能情况。
  • cpu run:表示运行 sysbench 的 CPU 测试模块,用以评估 CPU 的计算能力。

该命令通过多线程和固定时间的测试,帮助用户了解 CPU 在高负载下的性能表现。

命令执行结果

[root@flexusx-e724 sysbench-1.0.20]# sysbench --threads=4 --time=60 --report-interval=5 cpu run

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:

Number of threads: 4

Report intermediate results every 5 second(s)

Initializing random number generator from current time

Prime numbers limit: 10000

Initializing worker threads...

Threads started!

[ 5s ] thds: 4 eps: 11665.83 lat (ms,95%): 0.35

[ 10s ] thds: 4 eps: 11681.04 lat (ms,95%): 0.35

[ 15s ] thds: 4 eps: 11685.81 lat (ms,95%): 0.35

[ 20s ] thds: 4 eps: 11654.99 lat (ms,95%): 0.35

[ 25s ] thds: 4 eps: 11658.59 lat (ms,95%): 0.35

[ 30s ] thds: 4 eps: 11680.61 lat (ms,95%): 0.35

[ 35s ] thds: 4 eps: 11680.39 lat (ms,95%): 0.35

[ 40s ] thds: 4 eps: 11696.60 lat (ms,95%): 0.35

[ 45s ] thds: 4 eps: 11697.60 lat (ms,95%): 0.35

[ 50s ] thds: 4 eps: 11683.61 lat (ms,95%): 0.35

[ 55s ] thds: 4 eps: 11686.18 lat (ms,95%): 0.35

CPU speed:

events per second: 11678.94

General statistics:

total time: 60.0016s

total number of events: 700772

Latency (ms):

min: 0.34

avg: 0.34

max: 9.32

95th percentile: 0.35

sum: 239884.73

Threads fairness:

events (avg/stddev): 175193.0000/106.72

execution time (avg/stddev): 59.9712/0.00

在多核测试中,我们调动了Flexus X实例的所有可用核,测试其并行计算能力。随着核数的增加,CPU的总吞吐量显著提升。对于需要多线程处理的大规模并行任务,如视频编码、数据分析等,Flexus X实例表现出色,能够有效减少任务的执行时间。

4. 内存性能评测

内存的读写速度对很多应用的性能有着直接影响,尤其是在处理大规模数据集时,内存的吞吐量决定了数据处理的效率。通过sysbench的memory模块,我们对Flexus X实例的内存性能进行了详细测试。

4.1 内存读取性能

在内存读取测试中,Flexus X实例展现了快速的读取能力,尤其是在处理大量小数据块时,实例能够迅速响应并读取数据。这使得在大数据分析和实时应用场景中,内存性能能够支撑系统的高效运行。

内存读取评测命令

sysbench memory --memory-block-size=8K --memory-total-size=10G --memory-oper=read --memory-access-mode=rnd run

上述命令用于运行 sysbench 的内存性能测试,并指定了多个参数:

  • memory:表示运行 sysbench 的内存测试模块。
  • --memory-block-size=8K:每次操作的内存块大小为 8KB。
  • --memory-total-size=10G:测试过程中读写的内存总量为 10GB。
  • --memory-oper=read:执行内存读取操作,专注于读取性能的评估。
  • --memory-access-mode=rnd:内存访问模式为随机(random),即随机访问内存地址进行读操作。

该命令通过模拟随机读操作,评估内存在高负载下的随机读性能表现。

评测结果如下

[root@flexusx-e724 sysbench-1.0.20]# sysbench memory --memory-block-size=8K --memory-total-size=10G --memory-oper=read --memory-access-mode=rnd run

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:

Number of threads: 1

Initializing random number generator from current time

Running memory speed test with the following options:

block size: 8KiB

total size: 10240MiB

operation: read

scope: global

Initializing worker threads...

Threads started!

Total operations: 1310720 (289931.66 per second)

10240.00 MiB transferred (2265.09 MiB/sec)

General statistics:

total time: 4.5191s

total number of events: 1310720

Latency (ms):

min: 0.00

avg: 0.00

max: 0.03

95th percentile: 0.00

sum: 4385.45

Threads fairness:

events (avg/stddev): 1310720.0000/0.00

execution time (avg/stddev): 4.3855/0.00

4.2 内存写入性能

内存写入测试中,Flexus X实例同样表现优异,数据写入速度较快且稳定。对于需要频繁数据写入的任务,如日志记录、数据库操作等,Flexus X的内存性能表现足够支持高频写入操作,且没有出现明显的延迟或瓶颈。

内存写入评测命令

sysbench memory --memory-block-size=8K --memory-total-size=10G --memory-oper=write run

上述命令用于运行 sysbench 的内存写入性能测试,并指定了以下参数:

  • memory:表示运行 sysbench 的内存测试模块。
  • --memory-block-size=8K:每次操作的内存块大小为 8KB。
  • --memory-total-size=10G:测试过程中写入的内存总量为 10GB。
  • --memory-oper=write:执行内存写入操作,专注于评估写入性能。

该命令通过模拟大量内存写入操作,评估系统在处理大量数据写入时的内存性能表现。

评测结果如下

[root@flexusx-e724 sysbench-1.0.20]# sysbench memory --memory-block-size=8K --memory-total-size=10G --memory-oper=write run

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:

Number of threads: 1

Initializing random number generator from current time

Running memory speed test with the following options:

block size: 8KiB

total size: 10240MiB

operation: write

scope: global

Initializing worker threads...

Threads started!

Total operations: 1310720 (2363326.13 per second)

10240.00 MiB transferred (18463.49 MiB/sec)

General statistics:

total time: 0.5530s

total number of events: 1310720

Latency (ms):

min: 0.00

avg: 0.00

max: 0.01

95th percentile: 0.00

sum: 440.39

Threads fairness:

events (avg/stddev): 1310720.0000/0.00

execution time (avg/stddev): 0.4404/0.00

5. 磁盘I/O性能评测

磁盘I/O性能对云实例的存储操作影响巨大,特别是在需要频繁读写数据的应用中。我们通过fio对Flexus X实例的磁盘性能进行了顺序读写和随机读写测试。

5.1 顺序读写性能

在顺序读写测试中,Flexus X实例表现出色,磁盘的顺序读写速度非常快,能够支持大文件的快速读写操作。这使得在视频流处理、文件备份等场景中,Flexus X能够快速处理数据,提升系统整体性能。

使用命令

sysbench --threads=4 --time=60 --report-interval=5 fileio --file-num=2 --file-total-size=20G --file-test-mode=seqwr prepare

进行评测数据准备

[root@flexusx-e724 sysbench-1.0.20]# sysbench --threads=4 --time=60 --report-interval=5 fileio --file-num=2 --file-total-size=20G --file-test-mode=seqwr prepare

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

2 files, 10485760Kb each, 20480Mb total

Creating files for the test...

Extra file open flags: (none)

Creating file test_file.0

Creating file test_file.1

21474836480 bytes written in 136.52 seconds (150.01 MiB/sec).

顺序读写评测命令

sysbench --threads=4 --time=60 --report-interval=5 fileio --file-num=2 --file-total-size=20G --file-test-mode=seqwr run

上述命令用于运行 sysbench 的磁盘I/O性能测试,主要针对顺序写操作,并指定了以下参数:

  • --threads=4:设置线程数为 4,表示同时使用 4 个线程进行测试。
  • --time=60:测试持续时间为 60 秒。
  • --report-interval=5:每 5 秒输出一次测试报告,显示当前的性能情况。
  • fileio:表示运行 sysbench 的文件I/O测试模块。
  • --file-num=2:创建 2 个文件用于测试。
  • --file-total-size=20G:测试文件的总大小为 20GB。
  • --file-test-mode=seqwr:测试模式为顺序写(sequential write),即按照顺序向文件写入数据。

该命令用于评估系统磁盘的顺序写性能,模拟在多线程环境下处理大文件写入的表现。

评测结果如下

[root@flexusx-e724 sysbench-1.0.20]# sysbench --threads=4 --time=60 --report-interval=5 fileio --file-num=2 --file-total-size=20G --file-test-mode=seqwr run

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:

Number of threads: 4

Report intermediate results every 5 second(s)

Initializing random number generator from current time

Extra file open flags: (none)

2 files, 10GiB each

20GiB total file size

Block size 16KiB

Periodic FSYNC enabled, calling fsync() each 100 requests.

Calling fsync() at the end of test, Enabled.

Using synchronous I/O mode

Doing sequential write (creation) test

Initializing worker threads...

Threads started!

[ 5s ] reads: 0.00 MiB/s writes: 179.94 MiB/s fsyncs: 229.33/s latency (ms,95%): 0.035

[ 10s ] reads: 0.00 MiB/s writes: 148.75 MiB/s fsyncs: 190.40/s latency (ms,95%): 0.034

[ 15s ] reads: 0.00 MiB/s writes: 149.37 MiB/s fsyncs: 191.20/s latency (ms,95%): 0.035

[ 20s ] reads: 0.00 MiB/s writes: 150.00 MiB/s fsyncs: 192.00/s latency (ms,95%): 0.033

[ 25s ] reads: 0.00 MiB/s writes: 148.75 MiB/s fsyncs: 190.40/s latency (ms,95%): 0.035

[ 30s ] reads: 0.00 MiB/s writes: 150.00 MiB/s fsyncs: 192.00/s latency (ms,95%): 0.035

[ 35s ] reads: 0.00 MiB/s writes: 148.75 MiB/s fsyncs: 190.40/s latency (ms,95%): 0.035

[ 40s ] reads: 0.00 MiB/s writes: 150.00 MiB/s fsyncs: 192.00/s latency (ms,95%): 0.035

[ 45s ] reads: 0.00 MiB/s writes: 148.75 MiB/s fsyncs: 190.40/s latency (ms,95%): 0.035

[ 50s ] reads: 0.00 MiB/s writes: 150.00 MiB/s fsyncs: 192.00/s latency (ms,95%): 0.034

[ 55s ] reads: 0.00 MiB/s writes: 150.00 MiB/s fsyncs: 192.00/s latency (ms,95%): 0.035

[ 60s ] reads: 0.00 MiB/s writes: 148.75 MiB/s fsyncs: 190.40/s latency (ms,95%): 0.035

File operations:

reads/s: 0.00

writes/s: 9625.38

fsyncs/s: 192.62

Throughput:

read, MiB/s: 0.00

written, MiB/s: 150.40

General statistics:

total time: 60.6091s

total number of events: 595067

Latency (ms):

min: 0.01

avg: 0.41

max: 724.54

95th percentile: 0.03

sum: 242281.89

Threads fairness:

events (avg/stddev): 148766.7500/1811.96

execution time (avg/stddev): 60.5705/0.00

5.2 随机读写性能

相比顺序读写,随机读写测试更具挑战性,因为它涉及多个小块数据的随机位置读写。在该测试中,Flexus X实例的表现依然稳健,尽管随机读写的速度较顺序读写有所下降,但整体依旧保持在较高水平,足以应对数据库查询等需要频繁小块数据读写的场景。

随机读写测试数据准备命令

sysbench --threads=32 --time=30 --test=fileio --file-num=1 --file-block-size=8192 --file-total-size=20G --file-test-mode=rndrw --verbosity=5 prepare

执行结果

[root@flexusx-e724 ~]# sysbench --threads=32 --time=30 --test=fileio --file-num=1 --file-block-size=8192 --file-total-size=20G --file-test-mode=rndrw --verbosity=5 prepare

WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

1 files, 20971520Kb each, 20480Mb total

Creating files for the test...

Extra file open flags: (none)

Creating file test_file.0

21474836480 bytes written in 136.14 seconds (150.44 MiB/sec).

随机读写评测命令

sysbench --threads=4 --time=60 --report-interval=5 fileio --file-num=2 --file-total-size=20G --file-test-mode=seqwr run

上述命令用于运行 **sysbench** 的磁盘I/O性能测试,主要评估磁盘的随机读写性能。参数说明如下:

  • --threads=32:设置为使用 32 个线程同时进行测试,模拟高并发环境下的性能。
  • --time=30:测试持续时间为 30 秒。
  • --test=fileio:运行 sysbench 的文件I/O测试模块。
  • --file-num=1:测试时创建 1 个文件。
  • --file-block-size=8192:设置文件块大小为 8192 字节(8KB)。
  • --file-total-size=20G:测试文件的总大小为 20GB。
  • --file-test-mode=rndrw:测试模式为随机读写,即随机地从文件中读取和写入数据。
  • --verbosity=5:设置输出详细程度为 5,提供更详细的测试结果信息。

该命令通过多线程的随机读写操作,评估系统在高并发和大数据随机访问场景下的磁盘性能表现。

命令执行结果如下

[root@flexusx-e724 sysbench-1.0.20]# sysbench --threads=32 --time=30 --test=fileio --file-num=1 --file-block-size=8192 --file-total-size=20G --file-test-mode=rndrw --verbosity=5 run

WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.

sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:

Number of threads: 32

Initializing random number generator from current time

Extra file open flags: (none)

1 files, 20GiB each

20GiB total file size

Block size 8KiB

Number of IO requests: 0

Read/Write ratio for combined random IO test: 1.50

Periodic FSYNC enabled, calling fsync() each 100 requests.

Calling fsync() at the end of test, Enabled.

Using synchronous I/O mode

Doing random r/w test

DEBUG: Opening file: test_file.0

Initializing worker threads...

DEBUG: Worker thread (#0) started

DEBUG: Worker thread (#0) initialized

DEBUG: Worker thread (#1) started

... ...

DEBUG: Worker thread (#30) initialized

DEBUG: Worker thread (#31) initialized

Threads started!

Time limit exceeded, exiting...

(last message repeated 31 times)

Done.

File operations:

reads/s: 5705.56

writes/s: 3803.67

fsyncs/s: 96.13

Throughput:

read, MiB/s: 44.57

written, MiB/s: 29.72

General statistics:

total time: 30.2080s

total number of events: 290141

Latency (ms):

min: 0.00

avg: 3.33

max: 930.12

95th percentile: 0.52

sum: 966180.93

Threads fairness:

events (avg/stddev): 9066.9062/942.78

execution time (avg/stddev): 30.1932/0.04

6. 评测结果分析与总结

通过一系列性能测试,华为云Flexus X 实例在 CPU、内存和磁盘 I/O 等多个方面均展现了出色的表现,特别是在多线程处理和大数据处理场景中,体现了极高的稳定性和可靠性。具体来看:

  • 在CPU 性能方面,Flexus X 实例通过高效的多线程处理,在长时间计算任务中保持了优异的稳定性,表现出极小的执行时间偏差。
  • 在内存性能测试中,实例的内存读写速度表现出色,均匀的线程执行时间进一步证明了其在高负载情况下的卓越处理能力。
  • 对于磁盘 I/O,测试结果显示出极佳的读写效率,尤其是在随机读写场景下,Flexus X 实例表现出色,能够应对高并发的数据操作需求。

总体来说,华为云的 Flexus X 实例凭借其强大的硬件配置和优化的网络架构,成为了处理计算密集型、存储密集型以及网络密集型任务的理想选择。它不仅适用于企业级用户,还能很好地满足开发者和数据密集型应用的需求。

本次评测的结果充分展示了 Flexus X 实例的高性能与可靠性,特别是在需要高计算性能和大规模数据处理的场景下,其表现无疑具有显著优势。对于正在寻找高效云解决方案的用户,Flexus X 实例无疑是一个极具竞争力的选择,能够助力企业和开发者在实际应用中充分发挥其潜能。

相关推荐
lgbisha11 小时前
828华为云征文|华为云Flexus X实例docker部署最新Appsmith社区版,搭建自己的低代码平台
低代码·docker·华为云
A^mber12 小时前
828华为云征文|云服务器Flexus X实例|Ubunt部署Vue项目
运维·服务器·华为云
繁依Fanyi21 小时前
828 华为云征文|华为 Flexus 云服务器部署 RustDesk Server,打造自己的远程桌面服务器
运维·服务器·开发语言·人工智能·pytorch·华为·华为云
Linux猿1 天前
828华为云征文 | 云服务器Flexus X实例:多智能体对话框架 AutoGen 部署和实例运行
华为云·agent·多智能体·autogen·flexus云服务器x实例·华为云服务器·autogen studio
繁依Fanyi1 天前
828华为云征文|华为Flexus云服务器搭建OnlyOffice私有化在线办公套件
服务器·开发语言·前端·python·算法·华为·华为云
Just_Paranoid2 天前
828华为云征文|部署在线文件管理器 Spacedrive
docker·华为云·文件管理·flexus云服务器·spacedrive
Linux猿2 天前
828华为云征文 | 云服务器Flexus X实例:部署 Gitea,拥有自己的Git仓库,管理本地代码
服务器·华为云·gitea·云服务器·git仓库·flexus云服务器x实例·华为云服务器
Cloud Traveler2 天前
828华为云征文 | 解锁企业级邮件服务,在华为云fFlexus x实例上部署Mailcow开源方案
华为云
爱吃香蕉的阿豪2 天前
828华为云征文|Flexus X实例Docker+Jenkins+gitee实现CI/CD自动化部署-解放你的双手~
ci/cd·docker·gitee·华为云·jenkins
Just_Paranoid3 天前
828华为云征文|部署知识库问答系统 MaxKB
docker·llm·华为云·rag·anythingllm·ollama·maxkb