Using Unixbench for performance testing in Linux

Source: Internet
Author: User
Tags benchmark file copy set time vps


Unixbench is a Unix-like system (UNIX,BSD,LINUX) Performance testing tool, an open source tool, is widely used to test the performance of Linux system host. The main test projects of Unixbench are: System call, read-write, process, graphical test, 2D, 3D, Pipeline, operation, c library and other system benchmark performance to provide test data.

The latest version of UnixBench5.1.3, including system and GRAPHIC tests, if you need to test GRAPHIC, you need to modify makefile, do not comment out "graphic_tests = defined", Also requires the system to provide X11PERF command Gl_glibs library.
The following script uses the latest version of UnixBench5.1.3 to test, commenting on the graphic test items (most VPS are no video card or set up, so the image performance without testing), run 10-30 minutes (according to the number of CPU cores, operation time range) to score, the higher the better.

Test method:

wget http://file.111cn.net/upload/2014/1/unixbench.sh
chmod +x unixbench.sh
./unixbench.sh

Or simply save the following code as a unixbench.sh

#! /bin/bash
Path=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
Export PATH
#===============================================================================================
# Description:unixbench for Test
#===============================================================================================

# Create New Soft Download dir
Mkdir-p/opt/unixbench;
Cd/opt/unixbench;

# Download UnixBench5.1.3
If [-s unixbench5.1.3.tgz]; Then
echo "unixbench5.1.3.tgz [found]"
Else
echo "UNIXBENCH5.1.3.TGZ not found!!! Download Now ... "
if! Wget-c Http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz;then
echo "Failed to download unixbench5.1.3.tgz,please download it to"/opt/unixbench "directory manually and rerun the instal L script. "
Exit 1
Fi
Fi
Tar-xzf unixbench5.1.3.tgz;
CD unixbench;

Yum-y install gcc gcc-c autoconf gcc-c++ time Perl-time-hires

#Run Unixbench
Sed-i "s/graphic_tests = defined/#GRAPHIC_TESTS = defined/g"./makefile
Make
./run;

Echo ';
Echo ';
Echo ';
echo "======= Script description and score comparison completed! ======= ";
Echo ';
Echo ';
Echo ';


Test Project:
Dhrystone 2 Using Register variables
This entry is used to test string handling, because there is no floating-point operation, so deeply software and hardware design (hardware and software), compilation and linking (compiler and linker options), code optimization (codes Optimazaton), the effect on cache (cache memory), waiting state (wait states), integer data type (integers, types).

Double-precision Whetstone
This tests the speed and efficiency of floating-point operations. This test includes several modules, each of which includes a set of operations for scientific calculations. A wide range of C functions: Sin,cos,sqrt,exp,log is used for mathematical operations of integer and floating-point numbers, array access, conditional branching (conditional branch), and program invocation. This test also tests both integer and floating-point arithmetic operations.

EXECL throughput
This test examines the number of EXECL system calls that can be performed per second. The EXECL system call is a member of the EXEC function family. It is the front end of the Execve () function, just like some of the other commands that resemble it.

File Copy
Tests the rate at which data is transferred from one file to another. Use a different size buffer for each test. This is the number of files read, write, and copy operations in the set time (default 10s) for the test statistics for read, write, and copy operations.

Pipe throughput
Piping (pipe) is the simplest way to communicate between processes, where the pipe throughtput refers to the number of times a process can write 512-byte data to a pipe and then read it back in one second. It should be noted that pipe throughtput does not have a corresponding real existence in actual programming.

pipe-based Context Switching
This test two processes (per second) the number of times a growing integer is exchanged through a single pipe. This is very much to practical programming in some applications, the test program first create a subprocess, and this child process two-way pipeline transmission.

Process creation
Test the number of times per second that a process can create a child process and then retract the child process (the subprocess must exit immediately). Process creation focuses on the creation and memory allocation of new process control blocks, which focus on memory bandwidth. In general, this test is used to compare the different implementations of the system call that the operating system process creates.

System Call Overhead
Test the cost of entering and leaving the operating system kernel, that is, the cost of a system call. It achieves this by using a small program that repeatedly calls the Getpid function.

Shell Scripts
Test the number of n copies of a shell script that can be started concurrently by a process in one second, and N generally 1,2,4,8. (I took 1, 8 in the test). This script carries out a series of deformation operations on a data file (transformation).

Here is one of my 512mb,2 cores, the OpenVZ VPS's run-results:

BYTE UNIX Benchmarks (Version 5.1.3)

   system:vpn:gnu/linux
   os:gnu/linux--2.6.32-042stab076.8--#1 SMP Tue May 14 20:38:14 MSK 2013
   machine:i686 (i386)
   Language:en_US.utf8 (charmap= "UTF-8", collate= "UTF-8") br>    CPU 0:intel (R) Xeon (r) CPU L5520 @ 2.27GHz (4533.6 bogomips)
      &nb sp;   hyper-threading, x86-64, MMX, Physical address Ext, Sysenter/sysexit, Syscall/sysret, Intel Virtualization
   CPU 1:intel (R) Xeon (r) CPU L5520 @ 2.27GHz (4533.6 bogomips)
           hyper-threading, x86-64, MMX, Physical address Ext, Sysenter/sysexit, Syscall/sysret, Intel Virtualization
   09:41:17 up days,  9:21,  1 user,  load average:0.23, 0.05, 0.02; RunLevel 3

------------------------------------------------------------------------
Benchmark Run:mon June 29 2013 09:41:17-10:09:29
2 CPUs in System; Running 1 parallel copy of tests

Dhrystone 2 Using Register variables 17172222.3 LPs (10.0 s, 7 samples)
Double-precision Whetstone 2600.2 mwips (10.0 s, 7 samples)
Execl Throughput 4152.8 LPs (30.0 S, 2 samples)
File Copy 1024 bufsize maxblocks 622759.5 KBps (30.0 S, 2 samples)
File Copy 256 bufsize maxblocks 172634.3 KBps (30.0 S, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1218236.9 KBps (30.0 S, 2 samples)
Pipe Throughput 1416230.5 LPs (10.0 s, 7 samples)
pipe-based context switching 206509.4 LPs (10.0 s, 7 samples)
Process creation 8568.6 LPs (30.0 S, 2 samples)
Shell Scripts (1 concurrent) 3145.9 LPM (60.0 S, 2 samples)
Shell Scripts (8 concurrent) 528.3 LPM (60.0 S, 2 samples)
System Call Overhead 1528474.7 LPs (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE result index
Dhrystone 2 Using Register variables 116700.0 17172222.3 1471.5
Double-precision Whetstone 55.0 2600.2 472.8
Execl Throughput 43.0 4152.8 965.8
File Copy 1024 bufsize maxblocks 3960.0 622759.5 1572.6
File Copy 256 bufsize maxblocks 1655.0 172634.3 1043.1
File Copy 4096 bufsize 8000 maxblocks 5800.0 1218236.9 2100.4
Pipe Throughput 12440.0 1416230.5 1138.4
pipe-based context switching 4000.0 206509.4 516.3
Process creation 126.0 8568.6 680.0
Shell Scripts (1 concurrent) 42.4 3145.9 742.0
Shell Scripts (8 concurrent) 6.0 528.3 880.5
System call overhead 15000.0 1528474.7 1019.0
========
System Benchmarks Index Score 960.4

------------------------------------------------------------------------
Benchmark Run:mon June 29 2013 10:09:29-10:39:56
2 CPUs in System; Running 2 parallel copies of tests

Dhrystone 2 Using Register variables 16851634.7 LPs (10.0 s, 7 samples)
Double-precision Whetstone 5182.9 mwips (10.0 s, 7 samples)
Execl Throughput 4101.9 LPs (30.0 S, 2 samples)
File Copy 1024 bufsize maxblocks 635244.9 KBps (30.0 S, 2 samples)
File Copy 256 bufsize maxblocks 174430.2 KBps (30.0 S, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1219982.0 KBps (30.0 S, 2 samples)
Pipe Throughput 1387297.9 LPs (10.0 s, 7 samples)
pipe-based context switching 196296.1 LPs (10.0 s, 7 samples)
Process creation 10889.9 LPs (30.0 S, 2 samples)
Shell Scripts (1 concurrent) 4073.7 LPM (60.0 S, 2 samples)
Shell Scripts (8 concurrent) 550.5 LPM (60.2 s, 2 samples)
System Call Overhead 1538517.4 LPs (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE result index
Dhrystone 2 Using Register variables 116700.0 16851634.7 1444.0
Double-precision Whetstone 55.0 5182.9 942.3
Execl Throughput 43.0 4101.9 953.9
File Copy 1024 bufsize maxblocks 3960.0 635244.9 1604.2
File Copy 256 bufsize maxblocks 1655.0 174430.2 1054.0
File Copy 4096 bufsize 8000 maxblocks 5800.0 1219982.0 2103.4
Pipe Throughput 12440.0 1387297.9 1115.2
pipe-based context switching 4000.0 196296.1 490.7
Process creation 126.0 10889.9 864.3
Shell Scripts (1 concurrent) 42.4 4073.7 960.8
Shell Scripts (8 concurrent) 6.0 550.5 917.5
System call overhead 15000.0 1538517.4 1025.7
========
System Benchmarks Index Score

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.