ceph speed test

Schreiben (4K random write, 16 threads, 10 Sekunden)

rados bench -p 10 write --no-cleanup --object-size=4096 --concurrent-ios=16

Lesen (4K random read, 16 threads)

rados bench -p 10 rand --object-size=4096 --concurrent-ios=16

Schreib und Lese Test mit 4MB der default Größe für Ceph

rados bench -p 10 write --no-cleanup --object-size 4194304 --concurrent-ios 16

benchmark

bash -lc '
set -euo pipefail

POOL="ceph-ds"
SIZE="10G"
RUNTIME="30"
IODEPTH="32"
NUMJOBS="4"
RWMIXREAD="70" # 70/30 read/write wie oft bei VM-Workloads
BS="4k"

IMG="fio-bench-$(hostname -s)-$(date +%Y%m%d-%H%M%S)"
DEV=""

cleanup() {
set +e
echo ""
echo "[CLEANUP] unmap + remove (falls vorhanden) ..."
if [ -n "${DEV:-}" ]; then
rbd unmap "$DEV" >/dev/null 2>&1 || true
else
# falls DEV nicht gesetzt wurde, versuchen wir es über showmapped
rbd showmapped 2>/dev/null | awk -v p="$POOL" -v i="$IMG" '"'"'$2==p && $3==i {print $5}'"'"' | while read -r d; do
[ -n "$d" ] && rbd unmap "$d" >/dev/null 2>&1 || true
done
fi
rbd rm "${POOL}/${IMG}" >/dev/null 2>&1 || true
echo "[CLEANUP] fertig."
}
trap cleanup EXIT INT TERM

echo "[1/4] Create RBD image: ${POOL}/${IMG} (${SIZE})"
rbd create "${POOL}/${IMG}" --size "${SIZE}"

echo "[2/4] Map RBD image"
DEV="$(rbd map "${POOL}/${IMG}")"
echo " -> mapped as: ${DEV}"

echo "[3/4] fio VM-like test (randrw ${BS}, iodepth=${IODEPTH}, numjobs=${NUMJOBS}, rwmixread=${RWMIXREAD}, runtime=${RUNTIME}s)"
fio --name="ceph-rbd-${IMG}" \
--filename="${DEV}" \
--direct=1 --ioengine=libaio \
--rw=randrw --rwmixread="${RWMIXREAD}" \
--bs="${BS}" --iodepth="${IODEPTH}" --numjobs="${NUMJOBS}" \
--runtime="${RUNTIME}" --time_based=1 \
--group_reporting --eta=never

echo "[4/4] Done. Cleanup will run automatically."
'