Benchmark Kubernetes persistent disk volumes with fio
- Build the docker image using the Dockerfile supplied and upload to your local repo. This will pick up the latest version of FIO.
- Edit
dbench-statefulset.yaml
, updating
(a) the container/repo location, as built above (under containers/image)
(b) to keep things simple, the example uses the default storage class; either define a storageclass as required or set a default sc to match your env
(c) finally update the number of replicas required - Deploy Dbench using:
kubectl apply -f dbench-statefulset.yaml
- Once deployed, each POD will run a daemon of fio, thus creating a set of worker nodes.
- Run a FIO client to run jobs on the worker nodes, see notes below
- Once the tests are finished, clean up using:
kubectl delete -f dbench-statefulset.yaml
and delete the volumesk get pvc | awk '/dbench/{print $1}' | xargs -I {} kubectl delete pvc {}
You can either login to one of the PODs (recommended) or create VM to test with.
If running via a POD, skip to step 5
For the VM, follow steps 1-4 below
NOTE: pods must have routable networking if using a VM
- Download an Ubuntu (Jammy) image
- Install requirements:
sudo apt install gcc make zlib1g-dev
- Clone FIO:
git clone https://github.com/axboe/fio.git
- Make & install FIO:
cd fio
./configure
make
sudo make install
-
Define an FIO file (see example.fio)
-
Obtain the IP addresses of the pods, e.g.:
kubectl get pods -o wide | awk '/multi-dbench/{print $6}'
-
Log into one of the PODs or the FIO VM
-
Use VI to create two new text files, one containing the FIO parameters (xxx.fio) and the other a list of IP addresses (fio_workers)
-
Run FIO with the IP list and parameter file name, e.g.:
fio --client=fio_workers example.fio
- If the Persistent Volume Claim is stuck on Pending, check the default storageclass (or add the storageclass to the manifest)
- It can take some time for a Persistent Volume to be Bound
- When cloning ensure that the
docker-entrypoint.sh
has EXECUTE permissions
- Lee Liu (LogDNA)
- Alexis Turpin
- Dharmesh Bhatt
- MIT