Whamcloud - gitweb
b=17747
[fs/lustre-release.git] / lustre / tests / acceptance-metadata-double.sh
1 #!/bin/sh
2 set -e
3
4 #
5 # Runs create.pl and rename.pl on two mountpoints with increasing load, varying
6 # debug levels.  Assumes that the node is already setup with llmount2.sh
7 #
8
9 SRCDIR="`dirname $0`"
10 CREATE=$SRCDIR/create.pl
11 RENAME=$SRCDIR/rename.pl
12
13 TIME=${TIME:-/usr/bin/time}
14
15 display_elapsed_time() {
16     PREVIOUS_TS=$CURRENT_TS
17     CURRENT_TS=`date +%s`
18     BLOCK_ELAPSED=`expr $CURRENT_TS - $PREVIOUS_TS`
19     TOTAL_ELAPSED=`expr $CURRENT_TS - $START_TS`
20
21     echo " "
22     echo "Elapsed time (block): ${BLOCK_ELAPSED} seconds"
23     echo "Elapsed time (TOTAL): ${TOTAL_ELAPSED} seconds"
24     echo " "
25 }    
26
27 debug_client_on()
28 {
29         lctl set_param -n debug=-1
30 }
31
32 debug_client_off()
33 {
34         lctl set_param -n debug=0x3f0400
35 }
36
37 MNT=${MNT:-/mnt/lustre}
38
39 # Get our initial timestamps.
40 START_TS=`date +%s`
41 CURRENT_TS=$START_TS
42 PREVIOUS_TS=$START_TS
43
44 debug_client_on
45 echo "create.pl, 2 mounts, 1 thread, 10 ops, debug on"
46 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=10
47 echo "create.pl, 2 mounts, 1 thread, 100 ops, debug on"
48 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --silent
49 echo "create.pl --use_mcreate=0, 2 mounts, 1 thread, 10 ops, debug on"
50 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=10 --use_mcreate=0
51 echo "create.pl --use_mcreate=0, 2 mounts, 1 thread, 100 ops, debug on"
52 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --use_mcreate=0 --silent
53 echo "rename.pl, 2 mounts, 1 thread, 10 ops, debug on"
54 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=10
55 echo "rename.pl, 2 mounts, 1 thread, 100 ops, debug on"
56 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=100 --silent
57
58 display_elapsed_time
59
60 debug_client_off
61 echo "create.pl, 2 mounts, 1 thread, 1000 ops, debug off"
62 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=1000 --silent
63 echo "create.pl --use_mcreate=0, 2 mounts, 1 thread, 1000 ops, debug off"
64 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=1000 --use_mcreate=0 --silent
65 echo "rename.pl, 2 mounts, 1 thread, 1000 ops, debug off"
66 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=1000 --silent
67
68 display_elapsed_time
69
70 debug_client_on
71 echo "create.pl, 2 mounts, 2 threads, 100 ops, debug on"
72 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=2 --silent
73 echo "create.pl --use_mcreate=0, 2 mounts, 2 threads, 100 ops, debug on"
74 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=2 --use_mcreate=0 --silent
75 echo "rename.pl, 2 mounts, 2 thread, 1000 ops, debug on"
76 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=1000 --num_threads=2 --silent
77
78 display_elapsed_time
79
80 debug_client_off
81 echo "create.pl, 2 mounts, 2 threads, 2000 ops, debug off"
82 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=2 --silent
83 echo "create.pl --use_mcreate=0, 2 mounts, 2 threads, 2000 ops, debug off"
84 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=2 --use_mcreate=0 --silent
85 echo "rename.pl, 2 mounts, 2 threads, 2000 ops, debug off"
86 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=2 --silent
87
88 display_elapsed_time
89
90 debug_client_on
91 echo "create.pl, 2 mounts, 4 threads, 100 ops, debug on"
92 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=4 --silent
93 echo "create.pl --use_mcreate=0, 2 mounts, 4 threads, 100 ops, debug on"
94 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=100 --num_threads=4 --use_mcreate=0 --silent
95 echo "rename.pl, 2 mounts, 4 threads, 2000 ops, debug on"
96 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --silent
97
98 display_elapsed_time
99
100 debug_client_off
101 echo "create.pl, 2 mounts, 4 threads, 2000 ops, debug off"
102 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --silent
103 echo "create.pl --use_mcreate=0, 2 mounts, 4 threads, 2000 ops, debug off"
104 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --use_mcreate=0 --silent
105 echo "rename.pl, 2 mounts, 4 threads, 2000 ops, debug off"
106 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=4 --silent
107
108 display_elapsed_time
109
110 debug_client_on
111 echo "create.pl, 2 mounts, 8 threads, 500 ops, debug on"
112 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=500 --num_threads=8 --silent
113 echo "create.pl --use_mcreate=0, 2 mounts, 8 threads, 500 ops, debug on"
114 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=500 --num_threads=8 --use_mcreate=0 --silent
115 echo "rename.pl, 2 mounts, 8 threads, 2000 ops, debug on"
116 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --silent
117
118 display_elapsed_time
119
120 debug_client_off
121 echo "create.pl, 2 mounts, 8 threads, 2000 ops, debug off"
122 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --silent
123 echo "create.pl --use_mcreate=0, 2 mounts, 8 threads, 2000 ops, debug off"
124 $TIME perl $CREATE --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --use_mcreate=0 --silent
125 echo "rename.pl, 2 mounts, 8 threads, 2000 ops, debug off"
126 $TIME perl $RENAME --mountpt=${MNT} --num_mounts=2 --iterations=2000 --num_threads=8 --silent
127
128 display_elapsed_time