4. Benchmarking Virtual Machines

Aside from benchmarking cluster hardware nodes, you can also test performance from inside virtual machines created on Virtuozzo Hybrid Infrastructure. If you want compare other virtualization solutions with Virtuozzo Hybrid Infrastructure, make sure that VMs you run tests on have identical vCPUs, RAM and other parameters.

You may want to test the following:

  • A set up of one VM per cluster node. In this case, you will obtain results for the entire cluster with virtualization.

  • A single VM in the cluster. In this case you will obtain the maximum performance achievable inside VMs.

Important

The storage policy for the compute cluster must be set to “3 replicas”. For more details, see the Administrator’s Guide.

To prepare for testing, do the following on any node in the compute cluster:

  1. Install fio 3.3 or newer on all cluster nodes and on the machine you will run the benchmarks from (unless it is one of the cluster nodes):

    # yum install fio -y
    
  2. Download images of test VM templates:

    # wget https://docs.virtuozzo.com/fio/fio-test-images.tar.gz
    
  3. Extract VM images:

    # tar xvzf  fio-test-images.tar.gz
    
  4. Create templates from the extracted images:

    # vinfra service compute image create --file Centos7-fio-test-sys.qcow \
    --os-distro centos7 Centos7-fio-test-sys
    # vinfra service compute image create --file Centos7-fio-test-blank.qcow \
    Centos7-fio-test-blank
    
  5. Deploy test VMs from templates:

    # vinfra service compute server create FIO-Centos7 --count <N> --network id=<net> \
    --volume source=image,id=Centos7-fio-test-sys,size=10,boot-index=0 \
    --volume source=image,id=Centos7-fio-test-blank,size=64,boot-index=1 --flavor large
    

    Where

    • <N> is the number of nodes in your compute cluster, e.g., 5. It is recommended to create VMs on a clean cluster, so that each node will have one VM. If you want to test a single VM, use --count 1.

    • <net> is a network accessible by the host or virtual environment you will run the tests from, e.g., “Public”.

    This command will create and run the set number of identical virtual machines with these characteristics:

    • 4 vCPUs and 8 GB RAM (flavor “Large”). If you want to use another flavor, make sure to change job profiles accordingly: set size to at least double VM’s RAM divided by vCPUs and numjobs to the number of vCPUs.

    • A 10 GB Centos 7 system disk and a 64 GB ext4 disk for tests.

    • Attached to the chosen network.

    • Login: root, password: CDEkOA%rXfd%wWnOHDXm.

    • Fio benchmark installed, default fio port 8765 open, fio --server running.

  6. Download fio job profiles to a host or virtual environment that you will run the benchmark from. This host or VE must have network access to all test VMs.

    # wget -rnp -nH -R "index*" --cut-dirs=2 -e robots=off -A '*.fio' \
    https://docs.virtuozzo.com/fio/vm/
    

    Note

    VM job profiles cannot be used to benchmark cluster nodes.

  7. Create the dataset. From the directory with the fio profiles, run

    # for N in {<node1>,<node2>,...,<nodeN>}; do fio --minimal --client=$N prepare-set.fio; done
    

    Where nodeN is the host name or IP address of a test VM.

    This command will prepare identical test datasets on all test VMs in succession. This may take several minutes but will provide less deviation of results during actual benchmarking. Ignore any performance results displayed by this fio run.

    If you only want to test a single VM per cluster, run fio --minimal --client=<node1> prepare-set.fio.

  8. If cluster nodes have SSD/NVMe caches, make sure they have been flushed before running any benchmarks. You can check the caches as follows:

    1. On a cluster node, run

      # vstorage -c <cluster_name> top
      
    2. While in the text-based dashboard, press c to expand the chunks tab and then cycle columns with i until you see the JRN_FULL and FLAGS columns.

    3. Wait until JRN_FULL is 0% and each CS ID is marked by a c flag, e.g., “JC​c​”. This may take some time when the cluster is not under I/O load.

Now you are ready to run the benchmark. It is recommended to run read tests before write and read/write tests.

From the directory with the fio profiles, run the benchmark on all test VMs as follows (<nodeN> is the host name or IP address of a test VM):

  • Sequential read test:

    # fio  --client=<node1> seqread.fio --client=<node2> seqread.fio [...]
    
  • Random read test:

    # fio  --client=<node1> randread.fio --client=<node2> randread.fio [...]
    
  • Sequential write test (run after making sure that caches have been flushed):

    # fio  --client=<node1> seqwrite.fio --client=<node2> seqwrite.fio [...]
    
  • Random write test (run after making sure that caches have been flushed):

    # fio  --client=<node1> randwrite.fio --client=<node2> randwrite.fio [...]
    
  • Mixed read/write test (run after making sure that caches have been flushed):

    # fio  --client=<node1> randrw.fio --client=<node2> randrw.fio [...]
    
  • Expand test:

    # fio  --client=<node1> expand.fio --client=<node2> expand.fio [...]