Whamcloud - gitweb
LU-9633 ptlrpc: Add kernel doc style for ptlrpc (14)
[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 MOUNT_2=${MOUNT_2:-"yes"}
8
9 LUSTRE=${LUSTRE:-$(dirname $0)/..}
10 . $LUSTRE/tests/test-framework.sh
11 init_test_env "$@"
12 init_logging
13
14 ALWAYS_EXCEPT="$PERFORMANCE_SANITY_EXCEPT "
15 build_test_filter
16
17 check_and_setup_lustre
18
19 CLIENTS=${CLIENTS:-$HOSTNAME}
20
21 env_verify()
22 {
23         [[ -x "$MPIRUN" ]] || skip_env "no mpirun program found"
24         [[ -x "$MDTEST" ]] || skip_env "no mdtest program found"
25         get_mpiuser_id $MPI_USER
26         MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
27         $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
28 }
29
30 test_1() {
31         env_verify
32         echo "Small files creation performance test"
33         run_mdtest create-small
34 }
35 run_test 1 "small files create/open/delete"
36
37 test_2() {
38         env_verify
39         echo "Large files creation performance test"
40         # LU-2600/LU-4108 - Decrease load on zfs
41         if [[ "$SLOW" == no && "$mds1_FSTYPE" == zfs ]]; then
42                 NUM_FILES=10000
43         fi
44         run_mdtest create-large
45 }
46 run_test 2 "large files create/open/delete"
47
48 test_3() {
49         env_verify
50         NUM_DIRS=1
51         NUM_FILES=200000
52         echo "Single directory lookup rate for $NUM_FILES files"
53         run_mdtest lookup-single
54 }
55 run_test 3 "lookup rate 200k files in single directory"
56
57 test_4() {
58         env_verify
59         NUM_DIRS=100
60         NUM_FILES=200000
61         echo "Directory lookup rate $NUM_DIRS directories, $((NUM_FILES/NUM_DIRS)) files each"
62         run_mdtest lookup-multi
63 }
64 run_test 4 "lookup rate 200k files in 100 directories"
65
66 test_5a() {
67         local tmpfile=$DIR/$tfile
68
69         for((i=0; i < 20001; i++)) {
70                 echo "R$((i * 10)), 5"
71         } > $tmpfile
72         stack_trap "rm $tmpfile || true" EXIT
73
74         do_nodes $CLIENTS flocks_test 6 $DIR/$tfile $tmpfile &
75         do_nodes $CLIENTS flocks_test 6 $DIR2/$tfile $tmpfile &
76         wait || error "flocks_test failed"
77 }
78 run_test 5a "enqueue 20k no overlap flocks on same file"
79
80 test_5b() {
81         local tmpfile=$DIR/$tfile
82
83         echo "W0,99999999" > $tmpfile
84         for((i=0; i < 20001; i++)) {
85                 echo "R$((i * 10)), 5"
86         } >> $tmpfile
87         stack_trap "rm $tmpfile || true" EXIT
88
89         do_nodes $CLIENTS flocks_test 6 $DIR/$tfile $tmpfile &
90         do_nodes $CLIENTS flocks_test 6 $DIR2/$tfile $tmpfile &
91         wait || error "flocks_test failed"
92 }
93 run_test 5b "split a flock 20k times"
94
95 test_5c() {
96         local tmpfile=$DIR/$tfile
97
98         for((i=0; i < 20001; i++)) {
99                 echo "R$((i * 10)), 5"
100         } > $tmpfile
101         echo -e "R0,99999999\nT0" >> $tmpfile
102         stack_trap "rm $tmpfile || true" EXIT
103
104         do_nodes $CLIENTS flocks_test 6 $DIR/$tfile $tmpfile &
105         do_nodes $CLIENTS flocks_test 6 $DIR2/$tfile $tmpfile &
106         wait || error "flocks_test failed"
107 }
108 run_test 5c "merge 20k flocks"
109
110 test_5d() {
111         local tmpfile=$DIR/$tfile
112
113         echo "S20100" > $tmpfile
114         for((i=0; i < 20000; i++)) {
115                 echo -e "F$i\nR400, 100"
116         } >> $tmpfile
117         for((i=0; i < 20000; i++)) {
118                 echo -e "F$i\nR400, 101"
119         } >> $tmpfile
120         stack_trap "rm $tmpfile || true" EXIT
121
122         do_nodes $CLIENTS flocks_test 6 $DIR/$tfile $tmpfile &
123         do_nodes $CLIENTS flocks_test 6 $DIR2/$tfile $tmpfile &
124         wait || error "flocks_test failed"
125 }
126 run_test 5d "Enqueue 20k same range flocks, then expand them"
127
128 complete_test $SECONDS
129 check_and_cleanup_lustre
130 exit_status