Whamcloud - gitweb
LU-17744 ldiskfs: mballoc stats fixes
[fs/lustre-release.git] / lustre / tests / performance-sanity.sh
1 #!/bin/bash
2
3 set -e
4
5 TESTNAME=$(basename $0 .sh)
6 LOG=${LOG:-"$TMP/${TESTNAME}.log"}
7
8 LUSTRE=${LUSTRE:-$(dirname $0)/..}
9 . $LUSTRE/tests/test-framework.sh
10 init_test_env "$@"
11 init_logging
12
13 ALWAYS_EXCEPT="$PERFORMANCE_SANITY_EXCEPT "
14 build_test_filter
15
16 check_and_setup_lustre
17
18 env_verify()
19 {
20         [[ -x "$MPIRUN" ]] || skip_env "no mpirun program found"
21         [[ -x "$MDTEST" ]] || skip_env "no mdtest program found"
22         get_mpiuser_id $MPI_USER
23         MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
24         $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
25 }
26
27 test_1() {
28         env_verify
29         echo "Small files creation performance test"
30         # LU-2600/LU-4108 - Decrease load on zfs
31         if [[ "$SLOW" == no && "$mds1_FSTYPE" == zfs ]]; then
32                 NUM_FILES=10000
33         fi
34         run_mdtest create-small
35 }
36 run_test 1 "small files create/open/delete"
37
38 test_2() {
39         env_verify
40         echo "Large files creation performance test"
41         run_mdtest create-large
42 }
43 run_test 2 "large files create/open/delete"
44
45 test_3() {
46         env_verify
47         NUM_DIRS=1
48         NUM_FILES=200000
49         echo "Single directory lookup rate for $NUM_FILES files"
50         run_mdtest lookup-single
51 }
52 run_test 3 "lookup rate 200k files in single directory"
53
54 test_4() {
55         env_verify
56         NUM_DIRS=100
57         NUM_FILES=200000
58         echo "Directory lookup rate $NUM_DIRS directories, $((NUM_FILES/NUM_DIRS)) files each"
59         run_mdtest lookup-multi
60 }
61 run_test 4 "lookup rate 200k files in 100 directories"
62
63 test_5() {
64         touch $DIR/$tfile
65         for((i=0; i < 20000; i++)) {
66                 echo "W$((i * 10)), 5"
67         } | flocks_test 6 $DIR/$tfile
68         rm -r $DIR/$tfile
69 }
70 run_test 5 "enqueue 20k no overlap flocks on same file"
71
72 test_6() {
73         touch $DIR/$tfile
74         for((i=0; i < 20000; i++)) {
75                 [ $i -eq 0 ] && echo "W0,99999999" && continue
76                 echo "R$((i * 10)), 5"
77         } | flocks_test 6 $DIR/$tfile
78         rm -r $DIR/$tfile
79 }
80 run_test 6 "split a flock 20k times"
81
82 test_7() {
83         touch $DIR/$tfile
84         for((i=0; i < 20001; i++)) {
85                 echo "R$((i * 10)), 5"
86                 [ $i -eq 20000 ] && echo "W0,99999999" && continue
87         } | flocks_test 6 $DIR/$tfile
88         rm -r $DIR/$tfile
89 }
90 run_test 7 "merge 20k flocks"
91
92 complete_test $SECONDS
93 check_and_cleanup_lustre
94 exit_status