新睿云

> 弹性云服务器ECS > 云服务器测试性能如何的方法思路

云服务器测试性能如何的方法思路

作者/来源:新睿云小编 发布时间:2019-07-30

云服务器

在开始测试云服务器之前,推荐按量计费方式购买实例。同时确保用于对比的云服务器配置规格相同或具有可比性。

通过服务商提供的账户名和密码登陆云服务器之后,请先更新系统(本文所有操作均针对 Debian 系统)。

sudo apt-get -yupdate

在云服务器的测试过程,将先通过UnixBench 和 GeekBench这两个常用的基准测试工具,获得对主机的一个总体评分。

然后再从CPU、内存、磁盘 I/O等方面进行单项测试。

1. UnixBench

UnixBench 官网: https://github.com/kdlucas/byte-unixbench

UnixBench 是测试类 Unix 系统性能的老牌工具,也是常用的基准测试工具。

它会执行 11 个单项测试,包括字符串处理、浮点运算效率、 文件数据传输、管道吞吐等,然后将结果与一个基准系统进行比较,得到一个指数值。指数值越高,性能越好。

最终的得分比单个测试的结果根据参考价值,而且也方便对服务器进行比较。

在安装 UnixBench 之前,要先准备好相关的依赖。请执行:

sudo apt-get-y install libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make gcc

下载安装包,然后按下面的提示操作。官方的源在 googlecode 上,国内访问不便,我已经将文件上传到对象存储服务。

wget https://github.com/kdlucas/byte-unixbench/archive/master.zip

unzipmaster.zip

cd UnixBench

make

运行 make 之前,确保将 Makefile 文件中GRAPHICS_TEST = defined行被注释掉,因为我们是在服务器端进行测试,不需要做 2D/3D 图形测试。

最后,执行:

./Run

如果一切正常,应该会出现类似下面的文字:

代码1

UnixBench 测试的运行时间比较长,期间可以离开去干别的事情。

运行 ./Run 即可开始测试,等待十几分钟即可

1) 运行输出的部分结果:

Benchmark Run: Mon Sep 04 2017 20:22:53 - 20:51:13

1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables 23736936.0 lps (10.0 s, 7 samples)

Double-Precision Whetstone 3556.3 MWIPS (10.1 s, 7 samples)

Execl Throughput 3570.1 lps (29.9 s, 2 samples)

File Copy 1024 bufsize 2000 maxblocks 565755.4 KBps (30.0 s, 2 samples)

File Copy 256 bufsize 500 maxblocks 177397.0 KBps (30.0 s, 2 samples)

File Copy 4096 bufsize 8000 maxblocks 1337004.0 KBps (30.0 s, 2 samples)

Pipe Throughput 1145152.0 lps (10.0 s, 7 samples)

Pipe-based Context Switching 254288.8 lps (10.0 s, 7 samples)

Process Creation 11098.7 lps (30.0 s, 2 samples)

Shell Scripts (1 concurrent) 4001.7 lpm (60.0 s, 2 samples)

Shell Scripts (8 concurrent) 547.7 lpm (60.1 s, 2 samples)

System Call Overhead 1846761.4 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX

Dhrystone 2 using register variables 116700.0 23736936.0 2034.0

Double-Precision Whetstone 55.0 3556.3 646.6

Execl Throughput 43.0 3570.1 830.2

File Copy 1024 bufsize 2000 maxblocks 3960.0 565755.4 1428.7

File Copy 256 bufsize 500 maxblocks 1655.0 177397.0 1071.9

File Copy 4096 bufsize 8000 maxblocks 5800.0 1337004.0 2305.2

Pipe Throughput 12440.0 1145152.0 920.5

Pipe-based Context Switching 4000.0 254288.8 635.7

Process Creation 126.0 11098.7 880.9

Shell Scripts (1 concurrent) 42.4 4001.7 943.8

Shell Scripts (8 concurrent) 6.0 547.7 912.9

System Call Overhead 15000.0 1846761.4 1231.2

========

System Benchmarks Index Score 1064.1

2)运行后的目录结构

# ll

total 144

-rw-r--r-- 1 root root 10133 Jun 30 08:19 Makefile

drwxr-xr-x 2 root root 4096 Sep 4 20:22 pgms

-rw-r--r-- 1 root root 17753 Jun 30 08:19 README

drwxr-xr-x 2 root root 4096 Sep 4 20:22 results

-rwxr-xr-x 1 root root 60436 Jun 30 08:19 Run

drwxr-xr-x 2 root root 4096 Jun 30 08:19 src

drwxr-xr-x 2 root root 4096 Sep 4 20:51 testdir

drwxr-xr-x 2 root root 4096 Sep 4 20:36 tmp

-rw-r--r-- 1 root root 17890 Jun 30 08:19 USAGE

-rw-r--r-- 1 root root 4622 Jun 30 08:19 WRITING_TESTS

3) 查看 results/ 目录下的html结果

http://demo.mimvp.com/unixbench/

代码2

本文转自米扑博客,如有侵权请联系本站管理员删除!

热门标签
new year
在线咨询
咨询热线 400-1515-720
投诉与建议
{{item.description}}

—您的烦恼我们已经收到—

我们会将处理结果发送至您的手机

请耐心等待