Skip to content

Commit f6b0184

Browse files
kofemannmksahakyan
authored andcommitted
script: add dcache pool benchmark command
Motivation: Often admins want to know the expected I/O rates that a pool can provide. The desired benchmarks can be hart to configure. This, it makes sense to provide a 'good starting point' with dcache. Modification: update `dcache` command to provide `pool benchmark` command that will benchmark all configure pools in the layout file that that host. Optionally, a specific directory can be used. Result: simple test to benchmark pools filesystem ``` $ dcache pool benchmark Running fio benchmark for pool pool_write@dCacheDomain. seqwrite: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 seqread: (g=1): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 randread: (g=2): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 concurrent_write: (g=3): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 ... concurrent_randread: (g=4): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 ... fio-3.40 Starting 48 threads and 3 processes Jobs: 1 (f=1): [_(36),V(1),_(14)][100.0%][r=556MiB/s][r=142k IOPS][eta 00m:00s] seqwrite: (groupid=0, jobs=1): err= 0: pid=156310: Fri Mar 6 11:57:47 2026 .... Run status group 0 (all jobs): WRITE: bw=636MiB/s (667MB/s), 636MiB/s-636MiB/s (667MB/s-667MB/s), io=10.0GiB (10.7GB), run=16110-16110msec Run status group 1 (all jobs): READ: bw=628MiB/s (659MB/s), 628MiB/s-628MiB/s (659MB/s-659MB/s), io=10.0GiB (10.7GB), run=16298-16298msec Run status group 2 (all jobs): READ: bw=41.0MiB/s (43.0MB/s), 41.0MiB/s-41.0MiB/s (43.0MB/s-43.0MB/s), io=10.0GiB (10.7GB), run=249909-249909msec Run status group 3 (all jobs): WRITE: bw=1738MiB/s (1822MB/s), 1738MiB/s-1738MiB/s (1822MB/s-1822MB/s), io=240GiB (258GB), run=141418-141418msec Run status group 4 (all jobs): READ: bw=1845MiB/s (1935MB/s), 1845MiB/s-1845MiB/s (1935MB/s-1935MB/s), io=240GiB (258GB), run=133205-133205msec ``` Acked-by: Marina Sahakyan Target: master Require-book: no Require-notes: yes (cherry picked from commit 2e61583) Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
1 parent 47ab4da commit f6b0184

3 files changed

Lines changed: 137 additions & 0 deletions

File tree

skel/bin/dcache

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ usage()
5656
echo " pool ls"
5757
echo " pool reconstruct <directory> <target dir>"
5858
echo " pool yaml <name>"
59+
echo " pool benchmark [fio options] [ -- [<directory>]]"
5960
echo " property <property-name> [<domain-name> [<cell-name>]]"
6061
echo " restart [<domain>]..."
6162
echo " services"
@@ -611,6 +612,51 @@ case "$1" in
611612
) | column
612613
;;
613614

615+
benchmark)
616+
fio --version >/dev/null 2>&1 || fail 1 "fio is not installed. Please install fio to run the benchmark command."
617+
618+
fio_options=""
619+
while [ $# -gt 0 ]
620+
do
621+
case "$1" in
622+
--)
623+
shift
624+
break
625+
;;
626+
*)
627+
fio_options="$fio_options $1"
628+
shift
629+
;;
630+
esac
631+
done
632+
633+
[ $# -gt 1 ] && usage
634+
635+
if [ $# -eq 1 ]
636+
then
637+
path="$1"
638+
echo ""
639+
echo " Running fio benchmark for directory ${path}"
640+
echo ""
641+
fio --directory=${path} ${fio_options} ${lib}/pool-benchmark.fio
642+
else
643+
for domain in $(getProperty dcache.domains); do
644+
for cell in $(getProperty dcache.domain.cells "$domain"); do
645+
service=$(getProperty dcache.domain.service "$domain" "$cell")
646+
if [ "$service" = "pool" ]; then
647+
name=$(getProperty pool.name "$domain" "$cell")
648+
path=$(getProperty pool.path "$domain" "$cell")
649+
650+
echo ""
651+
echo " Running fio benchmark for pool $name@$domain."
652+
echo ""
653+
fio --directory=${path}/data ${fio_options} ${lib}/pool-benchmark.fio
654+
fi
655+
done
656+
done
657+
fi
658+
;;
659+
614660
*)
615661
usage
616662
;;

skel/man/man8/dcache.8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ to manually replace the content of the meta directory of the pool with
178178
the reconstructed database. It is recommended to keep a copy of the
179179
old database.
180180

181+
.TP
182+
.B pool benchmark [fio options ] [ -- directory]
183+
Run filesystem benchmarks on the file system containing the pool's \fBdata directory.
184+
The benchmark uses the fio tool. The options passed to the command are passed directly to fio.
185+
If a path is specified, the benchmark is run on specified directory only. Otherwise,
186+
the benchmark is run on all file systems for all configured pools.
187+
By default, the output of the benchmark is written to standard out.
188+
181189
.SH DATABASE MANAGEMENT COMMANDS
182190

183191
Several services in dCache rely on relational databases. The commands

skel/share/lib/pool-benchmark.fio

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
;
2+
; FIO workload to benchmark disk performance
3+
;
4+
; block verification information is forced on write, which is
5+
; used during read workloads.
6+
;
7+
;
8+
; Run sequential write, sequential read and random read
9+
;
10+
;
11+
; NOTE: ALL READ JOBS DELETE TEST FILE AFTER BENCHMARK
12+
;
13+
14+
[global]
15+
filename_format=fio-test-$jobnum-$filenum
16+
; file size
17+
size=10g
18+
ioengine=libaio
19+
; do not pre-create files
20+
create_on_open=1
21+
; checksum type
22+
verify=sha1
23+
; fail on first checksum error
24+
verify_fatal=1
25+
; invalidate page cache before running jobs
26+
invalidate=1
27+
28+
[seqwrite]
29+
description=Streaming WRITE
30+
rw=write
31+
; do not check sum during write
32+
do_verify=0
33+
; block until job is done before jumping to the next section
34+
stonewall
35+
36+
[seqread]
37+
description=Streaming READ
38+
rw=read
39+
; check checksum during read
40+
do_verify=1
41+
; block until job is done before jumping to the next section
42+
stonewall
43+
44+
[randread]
45+
description=Random READ
46+
rw=randread
47+
; inremental random offest
48+
rw_sequencer=sequential
49+
; check checksum during read
50+
do_verify=1
51+
; block until job is done before jumping to the next section
52+
stonewall
53+
; remove file at the end of the test
54+
unlink=1
55+
56+
[concurrent_write]
57+
description=Concurrent Streaming WRITE
58+
rw=write
59+
; do not check sum during write
60+
do_verify=0
61+
; block until job is done before jumping to the next section
62+
stonewall
63+
; write with multiple threads
64+
numjobs=24
65+
thread=1
66+
group_reporting=1
67+
68+
[concurrent_randread]
69+
description=Concurrent Random READ
70+
rw=randread
71+
rw=read
72+
; check checksum during read
73+
do_verify=1
74+
; block until job is done before jumping to the next section
75+
stonewall
76+
; read with multiple threads
77+
numjobs=24
78+
thread=1
79+
group_reporting=1
80+
; remove file at the end of the test
81+
unlink=1
82+
83+
; -- end job file --

0 commit comments

Comments
 (0)