VPS性能基准测试工具UnixBench用法

Kevin 教程 1,634 次浏览 8条评论

UnixBench是经典的类Unix系统基准测试工具,目的为检测系统处理任务的性能表现(评分不单取决CPU、内存、磁盘等硬件,还包括操作系统、驱动,甚至编译器)。UnixBench测试结果与预设基线系统得分进行比较,从而得出代表性能的数值分,分数越高表示性能越好。

UnixBench 安装

1. 下载UnixBench测试工具,目前最新版本是5.1.3。

wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/byte-unixbench/UnixBench5.1.3.tgz

如果Google Code下载地址用不了,可以使用这个Amazon地址,或者官方Github下载。

2. 下载后解压进入文件目录,然后编译。

tar -zxvf UnixBench5.1.3.tgz
cd UnixBench
make all

补充:如果编译过程中提示以下错误,说明没有安装GCC编译器。

make: gcc: Command not found
make: *** [pgms/arithoh] Error 127

可以直接软件仓库里获取安装,命令如下(对应系统所使用的包管理器)

yum install gcc
apt-get install gcc

3. UnixBench默认不测试显卡图像性能(VPS没必要)。如果Linux桌面版要测试,编译前打开目录下的Makefile文件,找到47行,取消里面的GRAPHIC_TESTS = defined参数注释。

UnixBench 测试

安装后运行./Run命令就可以开始标准测试,整个过程大概需时二十来分钟。如果希望同时测试图像性能则用./Run gindex命令(测试时间大约会增加三分之二)。为避免SSH连线超时断开,建议开个screen再测。

如果运行命令提示下面错误,表示系统缺少perl依赖项,UnixBench脚本是基于perl运行的。

-bash: ./Run: /usr/bin/perl: bad interpreter: No such file or directory

先安装perl组件。

yum install perl
apt-get install perl
UnixBench 其它参数(通过追加参数可改变测试方式)
./Run -q 以安静模式运行测试,之后可以文件方式查看结果(下文会提及)
./Run -v 以详细模式运行测试,实时打印测试内容到屏幕
./Run -i <count> -i <count>为每个项目设置重复测试次数,最少为1,默认是10
./Run -c <n> 为每个项目并行运行<n>个副本(图像性能测试不支持多副本运行)
./Run -c <n> <…>  <…>指定测试模式(包含哪些测试项目),默认为标准模式“index”,更多模式请查看USAGE文件说明

UnixBench 结果分析

UnixBench评测结果除了屏幕打印显示,还可以查看评测报告文件,在results目录下,文件名格式为”主机名-2018-07-11-01“,有html和log两个版本。

UnixBench通过执行多个不同类型任务来评估机器性能,其中包含的测试项目如下表格。

测试项目 测试内容
Dhrystone 该测试侧重字符串处理,没有浮点运算。结果受硬件设计和软件优化影响大
Whetstone 测试浮点运算速度和效率,其中包含几个典型的科学计算性能模块
Execl Throughput 测量 execl 每秒可执行的系统调用次数
File Copy 测试数据从一个文件传输到另一个文件的传输速率
Pipe Throughput 测试每秒一个进程将512字节写入管道并读取的次数
Pipe-based Context Switching 测试每秒两个进程通过一个管道交换一个不断增长的整数次数
Process Creation 测试每秒一个进程可以创建及收回子进程的次数
Shell Scripts 测试每秒进程可以并发获取一个 shell 脚本的 n 个副本的次数,n取值为1 2 4 8
System Call Overhead 测试进入和离开操作系统内核的开销,即执行系统调用的消耗
Graphical Tests 测试显卡2D和3D图形的大概性能,结果很视乎系统是否安装适当的驱动程序

正如开头所说,UnixBench是根据基线系统产生评分数据的,预设基线系统名为“George”,是一台SPARCstation 20-61模型,拥有128MB内存,SPARC存储阵列和Solaris 2.3(各测试项基线分可查看pgms\index.base文件)。评级标准分为10.0,因此如果检测评分为520,则表示比模型快52倍。

按现时主流的VPS配置,600分以上算普通级别,1000以上可以说性能比较好的了。

UnixBench性能测试
UnixBench性能测试结果示例

上面是我一台KVM机器的评分结果。如果你机器是多核CPU,那会有两个评分,一个是单进程跑,另一个是多进程。

类似UnixBench的基准评测工具还有不少,比如HardInfo和Sysbench,有兴趣的朋友不妨去试试。

评论列表

  1. #1

    I am glad for writing to make you know what a magnificent encounter my friend’s girl gained studying your web site. She learned several pieces, which include what it’s like to possess an awesome helping nature to let other folks very easily know just exactly several multifaceted subject matter. You truly exceeded people’s expectations. Thank you for presenting these powerful, safe, explanatory and in addition fun tips on your topic to Tanya. https://zujepopoem.online/

  2. #2

    I intended to create you one little note just to give thanks as before for the fantastic information you’ve discussed at this time. It has been quite remarkably generous of people like you to give openly exactly what a number of us might have marketed as an e book to end up making some dough for themselves, most importantly given that you could possibly have done it if you ever decided. These pointers as well served like the fantastic way to fully grasp other people have similar eagerness like my own to know lots more on the topic of this issue. I am certain there are millions of more fun opportunities in the future for individuals who looked at your blog post. https://nujemznuedi.online/

  3. #3

    I wanted to send you the very little remark to finally thank you the moment again over the remarkable tactics you have shared on this page. This has been simply surprisingly open-handed with you to offer unhampered what most of us would’ve offered for sale for an ebook to help make some money on their own, precisely seeing that you might have tried it in case you desired. Those suggestions in addition worked to become good way to realize that some people have the identical keenness similar to my personal own to realize significantly more when it comes to this matter. I believe there are several more pleasant sessions up front for people who scan your site. https://nujemznuedi.online/

  4. #4

    I am commenting to let you know of the great encounter my friend’s daughter found reading your site. She figured out numerous issues, not to mention what it’s like to have a wonderful giving mindset to have men and women quite simply have an understanding of selected hard to do subject areas. You really exceeded our expectations. Many thanks for giving the insightful, safe, explanatory and as well as easy thoughts on the topic to Janet. https://azzaroelectric.com/

  5. #5

    I’m commenting to let you be aware of of the beneficial discovery my child developed browsing the blog. She came to find a lot of details, including how it is like to have a great coaching character to get certain people completely comprehend a number of complex issues. You actually did more than her desires. I appreciate you for coming up with such effective, dependable, edifying and cool guidance on that topic to Ethel. https://harrington-service.com/

  6. #6

    I am only writing to make you understand what a remarkable experience our princess undergone viewing your webblog. She picked up some things, which included what it is like to possess an ideal teaching spirit to make the mediocre ones without difficulty master specified tortuous things. You undoubtedly surpassed readers’ expected results. Thanks for rendering those useful, trustworthy, revealing as well as unique tips on your topic to Mary. https://lexaproescitalopram.com/

  7. #7

    Thanks for your own labor on this web site. My mother take interest in participating in research and it is simple to grasp why. My spouse and i notice all regarding the powerful way you produce useful thoughts via your website and in addition recommend response from the others on this subject then our own princess is undoubtedly studying a whole lot. Take pleasure in the rest of the year. You have been performing a terrific job. https://endepamitriptyline.com/

  8. #8

    I’m commenting to let you be aware of of the awesome discovery my child developed browsing the blog. She came to find a good number of details, including how it is like to have a great coaching character to get a number of people clearly completely grasp a number of advanced issues. You actually did more than her desires. I appreciate you for churning out such effective, dependable, edifying and cool guidance on that topic to Emily. https://lexaproescitalopram.com/

发表评论

电邮地址用于 Gravatar 头像显示,不会被公开可见。