PerfKit Benchmarker
PerfKit Benchmarker is an open effort to define a canonical set of benchmarks to
measure and compare cloud offerings. It's designed to operate via vendor
provided command line tools. The benchmark default settings are not tuned for
any particular platform or instance type. These settings are recommended for
consistency across services. Only in the rare case where there is a common
practice like setting the buffer pool size of a database do we change any
settings.
This README is designed to give you the information you need to get running with
the benchmarker and the basics of working with the code. The
wiki contains
more detailed information:
Licensing
PerfKit Benchmarker provides wrappers and workload definitions around popular
benchmark tools. We made it very simple to use and automate everything we can.
It instantiates VMs on the Cloud provider of your choice, automatically installs
benchmarks, and runs the workloads without user interaction.
Due to the level of automation you will not see prompts for software installed
as part of a benchmark run. Therefore you must accept the license of each of the
benchmarks individually, and take responsibility for using them before you use
the PerfKit Benchmarker.
Moving forward, you will need to run PKB with the explicit flag
--accept-licenses.
In its current release these are the benchmarks that are executed:
Some of the benchmarks invoked require Java. You must also agree with the
following license:
SPEC CPU2006 benchmark setup cannot be
automated. SPEC requires that users purchase a license and agree with their
terms and conditions. PerfKit Benchmarker users must manually download
cpu2006-1.2.iso from the SPEC website, save it under the
perfkitbenchmarker/data folder (e.g.
~/PerfKitBenchmarker/perfkitbenchmarker/data/cpu2006-1.2.iso), and also supply
a runspec cfg file (e.g.
~/PerfKitBenchmarker/perfkitbenchmarker/data/linux64-x64-gcc47.cfg).
Alternately, PerfKit Benchmarker can accept a tar file that can be generated
with the following steps:
- Extract the contents of
cpu2006-1.2.iso into a directory named cpu2006
- Run
cpu2006/install.sh
- Copy the cfg file into
cpu2006/config
- Create a tar file containing the
cpu2006 directory, and place it under the
perfkitbenchmarker/data folder (e.g.
~/PerfKitBenchmarker/perfkitbenchmarker/data/cpu2006v1.2.tgz).
PerfKit Benchmarker will use the tar file if it is present. Otherwise, it will
search for the iso and cfg files.
Getting Started
To quickly get started running PKB, follow one of our tutorials:
- Beginner tutorial for an in-depth but
beginner friendly look at PKB's architectures, flags, and even data
visualization, using GCP's Cloud Shell & netperf benchmarks.
- Docker tutorial to run PKB in just a few
steps, using GCP & docker.
- Continue reading below for installation & setup on all Clouds + discussion
of many topics like flags, configurations, preprovisioned data, & how to
make contributions.
Installation and Setup
Before you can run the PerfKit Benchmarker, you need account(s) on the cloud
provider(s) you want to benchmark (see
providers). You also need the software
dependencies, which are mostly command line tools and credentials to access your
accounts without a password. The following steps should help you get up and
running with PKB.
Python 3
The recommended way to install and run PKB is in a virtualenv with the latest
version of Python 3 (at least Python 3.12). Most Linux distributions and recent
Mac OS X versions already have Python 3 installed at /usr/bin/python3.
If Python is not installed, you can likely install it using your distribution's
package manager, or see the
Python Download page.
# install pyenv to install python on persistent home directory
curl https://pyenv.run | bash
# add to path
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
# update bashrc
source ~/.bashrc
# install python 3.12 and make default
pyenv install 3.12
pyenv global 3.12
Install PerfKit Benchmarker
Download the latest PerfKit Benchmarker release from
GitHub. You
can also clone the working version with:
$ cd $HOME
$ git clone https://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git
Install Python library dependencies:
$ pip3 install -r $HOME/PerfKitBenchmarker/requirements.txt
You may need to install additional dependencies depending on the cloud provider
you are using. For example, for
AWS:
$ cd $HOME/PerfKitBenchmarker/perfkitbenchmarker/providers/aws
$ pip3 install -r requirements.txt
Preprovisioned data
Some benchmarks may require data to be preprovisioned in a cloud. To
preprovision data, you will need to obtain the data and then upload it to that
cloud. See more information below about which benchmarks require preprovisioned
data and how to upload it to different clouds.
Running a Single Benchmark
PerfKit Benchmarker can run benchmarks both on Cloud Providers (GCP, AWS, Azure,
DigitalOcean) as well as any "machine" you can SSH into.
Example run on GCP
$ ./pkb.py --project=<GCP project ID> --benchmarks=iperf --machine_type=f1-micro
Example run on AWS
$ cd PerfKitBenchmarker
$ ./pkb.py --cloud=AWS --benchmarks=iperf --machine_type=t2.micro
Example run on Azure
$ ./pkb.py --cloud=Azure --machine_type=Standard_A0 --benchmarks=iperf
Example run on IBMCloud
$ ./pkb.py --cloud=IBMCloud --machine_type=cx2-4x8 --benchmarks=iperf
Example run on AliCloud
$ ./pkb.py --cloud=AliCloud --machine_type=ecs.s2.large --benchmarks=iperf
Example run on DigitalOcean
$ ./pkb.py --cloud=DigitalOcean --machine_type=16gb --benchmarks=iperf
Example run on OpenStack
$ ./pkb.py --cloud=OpenStack --machine_type=m1.medium \
--openstack_network=private --benchmarks=iperf
Example run on Kubernetes
$ ./pkb.py --vm_platform=Kubernetes --benchmarks=iperf \
--kubeconfig=/path/to/kubeconfig --use_k8s_vm_node_selectors=False