Code Monkey home page Code Monkey logo

virt-perf-scripts's Introduction

virt-perf-scripts

The performance test scripts for virtualization.

FIO test

This tool is designed for running an FIO benchmark in guest.

Prepare the guest

  1. Install fio on the guest.

sudo yum install -y libaio fio gnuplot

  1. Install the following Python modules:
  • click
  • pandas
  • numpy
  • scipy
  • yaml

Notes:
You can use ./block/setup.sh for step 1 and 2 on RHEL systems.

  1. Deliver the following scripts to the guest:
  • ./block/RunFioTest.py
  • ./block/GenerateBenchmarkReport.py
  • ./block/GenerateTestReport.py
  • ./virt_perf_scripts.yaml

Run FIO test

The manual page of RunFioTest.py:

$ python3 ./RunFioTest.py --help
Usage: RunFioTest.py [OPTIONS]

  Command line interface.

  Take arguments from CLI, load default parameters from yaml file. Then
  initialize the fio test.

Options:
  --backend TEXT           The backend device where vdisk image is based on.
  --driver TEXT            The driver to power the vdisk..
  --fs TEXT                The filesystem of the disk to be tested, "RAW" for
                           no fs.
  --rounds INTEGER RANGE   How many rounds the fio test will be repeated.
  --filename TEXT          [FIO] The disk(s) or specified file(s) to be tested
                           by fio. You can specify a number of targets by
                           separating the names with a ':' colon.
  --runtime TEXT           [FIO] Terminate a job after the specified period of
                           time.
  --ioengine TEXT          [FIO] Defines how the job issues I/O to the file.
                           Such as: 'libaio', 'io_uring', etc.
  --direct INTEGER RANGE   [FIO] Direct access to the disk.
  --numjobs INTEGER RANGE  [FIO] Create the specified number of clones of the
                           job.
  --rw_list TEXT           [FIO] Type of I/O pattern.
  --bs_list TEXT           [FIO] The block size in bytes used for I/O units.
  --iodepth_list TEXT      [FIO] # of I/O units to keep in flight against the
                           file.
  --log_path TEXT          Where the *.fiolog files will be saved to.
  --plots / --no-plots     Generate bw/iops/lat logs and plots in their
                           lifetime.
  --dryrun                 Print the commands that would be executed, but do
                           not execute them.
  --help                   Show this message and exit.

If you run ./RunFioTest.py without any parameter, it will load default value from ./virt_perf_scripts.yaml. Please check the yaml file for details.

Typically, you should run the following command to provide enough information:

$ python3 ./RunFioTest.py --backend NVME --driver SCSI --fs RAW --filename /dev/sdb --log_path $HOME/workspace/log/ESXi_FIO_RHEL7u6_20180809

This command will create $HOME/workspace/log/ESXi_FIO_RHEL7u6_20180809 and generate *.fiolog file for each subcase to this path.

Generate FIO test report

The manual page of GenerateTestReport.py:

$ python3 ./GenerateTestReport.py --help
Usage: GenerateTestReport.py [OPTIONS]

  Command Line Interface.

Options:
  --result_path PATH  Specify the path where *.fiolog files are stored in.
  --report_csv PATH   Specify the name of CSV file for fio test reports.
  --help              Show this message and exit.

Typically, you should run the following command:

$ python3 ./GenerateTestReport.py --result_path $HOME/workspace/log/ESXi_FIO_RHEL7u6_20180809 --report_csv ESXi_FIO_RHEL7u6_20180809.csv

This command will create a CSV test report with all the performance KPIs in.

Generate FIO benchmark report

The manual page of GenerateBenchmarkReport.py:

$ python3 ./GenerateBenchmarkReport.py --help
Usage: GenerateBenchmarkReport.py [OPTIONS]

  Command Line Interface.

Options:
  --base_csv PATH    Specify the CSV file of the base samples.
  --test_csv PATH    Specify the CSV file of the test samples.
  --report_csv PATH  Specify the CSV file to store the benchmark report.
  --help             Show this message and exit.

Typically, you should run the following command:

$ python3 ./GenerateBenchmarkReport.py --base_csv ./ESXi_FIO_RHEL7u5_20180401.csv --test_csv ./ESXi_FIO_RHEL7u6_20180809.csv --report_csv ESXi_FIO_Benchmark_RHEL7u6_against_RHEL7u5_20180809.csv

This command will create a CSV benchmark report which comparing RHEL7.6 performance KPIs against RHEL7.5.

About the index and conclusion

The conclusion can be the following values in specific situations:

Conclusion              Situation
Data Invalid            The input data is invalid;
Variance Too Large      The %SD beyonds the MAX_PCT_DEV;
No Difference           The %DIFF is zero;
No Significance         The Significance less than CONFIDENCE_THRESHOLD;
Major Improvement       The Significance beyonds CONFIDENCE_THRESHOLD and %DIFF beyonds REGRESSION_THRESHOLD;
Major Regression        The Significance beyonds CONFIDENCE_THRESHOLD and %DIFF beyonds REGRESSION_THRESHOLD;
Minor Improvement       The Significance beyonds CONFIDENCE_THRESHOLD but %DIFF belows REGRESSION_THRESHOLD;
Minor Regression        The Significance beyonds CONFIDENCE_THRESHOLD but %DIFF belows REGRESSION_THRESHOLD;

MAX_PCT_DEV = 10
REGRESSION_THRESHOLD = 5
CONFIDENCE_THRESHOLD = 0.95

Calculation:

AVG = SUM(the performance number of sample 1~5) / 5
%SD = (The Standard Deviation of the 5 samples) / AVG * 100%
%DIFF = (TEST-AVG - BASE-AVG) / BASE-AVG * 100%
Significance = (1 - TTEST(BASE Sample 1~5, TEST Sample 1~5))

Paste the results into Google Speardsheets

You can copy & paste the contents from CSV file into the Template of Google Speardsheets. So that you could check the benchmark results much more conveniently.

virt-perf-scripts's People

Contributors

boyang2019 avatar schrht avatar yangboroy avatar yuxisun1217 avatar zhaohuijuan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

virt-perf-scripts's Issues

[Errno 2] No such file or directory: './virt_perf_scripts.yaml'

Hi shichen,
when I try to run on RHEL by default,there is a error can not found yaml file, the yaml file is on upper folder.
could you help define the path?

./RunFioTest.py
[WARNING] Fail to get default value from yaml file. [Errno 2] No such file or directory: './virt_perf_scripts.yaml'

GenerateTestReport.py: Error while parsing disk_util: length != 1

$ GenerateTestReport.py ./rhel75_830 rhel75_830_fio_report.csv
Error while parsing disk_util: length != 1
Error while parsing disk_util: length != 1
Error while parsing disk_util: length != 1
Error while parsing disk_util: length != 1
Error while parsing disk_util: length != 1
......
Error while parsing disk_util: length != 1
Error while parsing disk_util: length != 1
Dumping data into csv file "rhel75_830_fio_report.csv"...
Finished!
$

GenerateBenchmarkReport.py: TypeError: Could not convert to numeric

$ GenerateBenchmarkReport.py rhel74_fio_report.csv rhel75_830_fio_report.csv benchmark_report.csv
Reading base samples from csv file "rhel74_fio_report.csv"...
Reading test samples from csv file "rhel75_830_fio_report.csv"...
Traceback (most recent call last):
File "/home/cheshi/bin/GenerateBenchmarkReport.py", line 364, in
generate_fio_benchmark_report()
File "/usr/lib/python2.7/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/cheshi/bin/GenerateBenchmarkReport.py", line 353, in generate_fio_benchmark_report
fbr.generate_report()
File "/home/cheshi/bin/GenerateBenchmarkReport.py", line 297, in generate_report
self._complete_report_dataframe()
File "/home/cheshi/bin/GenerateBenchmarkReport.py", line 264, in _complete_report_dataframe
series, my_sub_base, my_sub_test, 'Util', 'Util(%)', True)
File "/home/cheshi/bin/GenerateBenchmarkReport.py", line 210, in _calculate_and_fill_report_series
series[label + '-TEST-AVG'] = df_test[source_label].mean()
File "/usr/lib64/python2.7/site-packages/pandas/core/generic.py", line 7315, in stat_func
numeric_only=numeric_only)
File "/usr/lib64/python2.7/site-packages/pandas/core/series.py", line 2577, in _reduce
return op(delegate, skipna=skipna, **kwds)
File "/usr/lib64/python2.7/site-packages/pandas/core/nanops.py", line 77, in _f
return f(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/pandas/core/nanops.py", line 131, in f
result = alt(values, axis=axis, skipna=skipna, **kwds)
File "/usr/lib64/python2.7/site-packages/pandas/core/nanops.py", line 356, in nanmean
the_sum = _ensure_numeric(values.sum(axis, dtype=dtype_sum))
File "/usr/lib64/python2.7/site-packages/pandas/core/nanops.py", line 825, in _ensure_numeric
.format(value=x))
TypeError: Could not convert 99.91494299.93327999.91327899.93828299.911606 to numeric
$

The GenerateTestReport.py doesn't work when just have one round fio test rusult

if we just run one round fio test, then run the generate test report script, there is error message.

[root@bootp-73-199-100 tmp]# ./GenerateTestReport.py 
  File "./GenerateTestReport.py", line 49
    for key, value in inputs.iteritems()
      ^
SyntaxError: invalid syntax
[root@bootp-73-199-100 tmp]# 

please check the reason.
Thanks
ldu

Error while extracting performance KPIs: 'disk_util'

Error while extracting performance KPIs: 'disk_util'

[cheshi@cheshi-laptop2 ESXi]$ GenerateTestReport.py fio_result.rhel75 rhel75.csv 
Error while extracting performance KPIs: 'disk_util'
[cheshi@cheshi-laptop2 ESXi]$ 

Document Refinement about introduction

Following list some suggestion about documents:

1. fio document added suggestion:

how many cpu needed? memory needed for seting up vm

2. Default parameter explanation, e.g runtime 1 minute, size =512M

3. Typical scenario 
不同场景的测试公式基本一致,只有3个参数(读写模式,iodepth,blocksize)的区别。下面举例说明使用block size为4k,iodepth为1来测试顺序读性能的命令。
FIO: https://blog.csdn.net/qq_36357820/article/details/79965014
block=4k iodepth=1 随机读测试,能反映磁盘的时延性能;
block=128K iodepth=32 能反映峰值吞吐性能 ;
block=4k iodepth=32 能反映峰值IOPS性能
  1. Some parameter suggestions?
    read
    Sequential reads.
    write
    Sequential writes.
    rw,readwrite
    Sequential mixed reads and writes.

    randread
    Random reads.
    randwrite
    Random writes.
    read, write, rw -- numberjobs better 1
    randread, readwrite, rw, -- numberjobs better 16.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.