I have been trying to get a comparison of IO performance between VMs, containers (backed by ZFS) and the host. For that I have run the following script:
COUNT="1000k"
dd if=/dev/urandom of=/tmp/input bs=1k count="$COUNT"
sync; echo 3 | tee /proc/sys/vm/drop_caches ;dd if=/tmp/input of=/tmp/test bs=1k count="$COUNT"
sync; echo 3 | tee /proc/sys/vm/drop_caches ;dd if=/tmp/test of=/dev/null bs=1k count="$COUNT"
I have noticed that while on the host the IO performance is normal, within a container instance for example, both commands top out at around 1.5MB/s (as opposed to 105MB/s and 304MB/s respectively on host for the first and second set of dd
commands).
What would be the optimal way to benchmark ZFS backed instances so that ARC does not inflate the performance values but also do not skip cache entirely so as to not have abysmal performance?
Following is the output of lxc config
for the container used for testing:
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 20.04 LTS amd64 (release) (20201210)
image.label: release
image.os: ubuntu
image.release: focal
image.serial: "20201210"
image.type: squashfs
image.version: "20.04"
limits.cpu: "4"
limits.memory: 4GB
limits.memory.enforce: hard
volatile.base_image: e0c3495ffd489748aa5151628fa56619e6143958f041223cb4970731ef939cb6
volatile.eth0.host_name: vetha7125db5
volatile.eth0.hwaddr: 00:16:3e:40:2b:02
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.power: RUNNING
volatile.uuid: 26ace09d-03dc-44ab-b9d1-cf1cf2b3fbe2
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: temp
size: 50GB
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""