Whamcloud - gitweb
Some racy problems happened when sanity-quota.sh run on buffalo.
[fs/lustre-release.git] / lustre / tests / acceptance-metadata-parallel.sh
1 #!/bin/sh
2 set -e
3
4 #########################################################################
5 # Runs create.pl on a single mountpoint and directory with increasing
6 # load across multiple clients.
7 #########################################################################
8
9 LUSTRE=${LUSTRE:-`dirname $0`/..}
10 LTESTDIR=${LTESTDIR:-$LUSTRE/../ltest}
11 PATH=$LUSTRE/utils:$LUSTRE/tests:$PATH
12  
13 RLUSTRE=${RLUSTRE:-$LUSTRE}
14 RPWD=${RPWD:-$PWD}
15  
16 . $LUSTRE/tests/test-framework.sh
17
18 TIME=${TIME:-/usr/bin/time}
19 PDSH=${PDSH:-"pdsh -S -w"}
20 MOUNTPT=${MOUNTPT:-"/mnt/lustre"}
21
22 CREATE=$LUSTRE/tests/create.pl
23 RENAME=$LUSTRE/tests/rename.pl
24
25 [ -z "$CLIENTS" ] && exit 1
26 #CLIENTS=`comma_list $CLIENTS`
27
28 display_elapsed_time() {
29     PREVIOUS_TS=$CURRENT_TS
30     CURRENT_TS=`date +%s`
31     BLOCK_ELAPSED=`expr $CURRENT_TS - $PREVIOUS_TS`
32     TOTAL_ELAPSED=`expr $CURRENT_TS - $START_TS`
33
34     echo " "
35     echo "Elapsed time (block): ${BLOCK_ELAPSED} seconds"
36     echo "Elapsed time (TOTAL): ${TOTAL_ELAPSED} seconds"
37     echo " "
38 }    
39
40 set_debug_level() 
41 {
42     $PDSH $CLIENTS "echo $1 > /proc/sys/lnet/debug"
43 }
44
45 debug_client_on()
46 {
47     set_debug_level -1
48 }
49
50 debug_client_partial()
51 {
52     set_debug_level 0x3f0400
53 }
54
55 debug_client_off()
56 {
57     set_debug_level 0
58 }
59
60 # Get our initial timestamps.
61 START_TS=`date +%s`
62 CURRENT_TS=$START_TS
63 PREVIOUS_TS=$START_TS
64
65 debug_client_off
66
67 echo "create.pl, 1 mount, 1 thread, 1000 ops"
68 $TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --silent"
69 #echo "create.pl --mcreate=0, 1 mount, 1 thread, 1000 ops, debug off"
70 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --use_mcreate=0 --silent"
71 wait
72 #echo "rename.pl, 1 mount, 1 thread, 1000 ops, debug off"
73 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=1000 --silent"
74
75 display_elapsed_time
76
77 echo "create.pl, 1 mount, 2 threads, 2000 ops, debug off"
78 $TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent"
79 #echo "create.pl --mcreate=0, 1 mount, 2 threads, 2000 ops, debug off"
80 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --use_mcreate=0  --silent"
81 wait
82 #echo "rename.pl, 1 mount, 2 threads, 2000 ops, debug off"
83 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=2 --silent#
84
85 display_elapsed_time
86
87 echo "create.pl, 1 mount, 4 threads, 2000 ops, debug off"
88 $TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4  --silent"
89 #echo "create.pl --mcreate=0, 1 mount, 4 threads, 2000 ops, debug off"
90 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4  --use_mcreate=0 --silent"
91 wait
92 #echo "rename.pl, 1 mount, 4 threads, 2000 ops, debug off"
93 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=4 --silent"
94
95 display_elapsed_time
96
97 echo "create.pl, 1 mount, 8 threads, 2000 ops, debug off"
98 $TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8  --silent"
99 #echo "create.pl --mcreate=0, 1 mount, 8 threads, 2000 ops, debug off"
100 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $CREATE --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8  --use_mcreate=0 --silent"
101 wait
102 #echo "rename.pl, 1 mount, 8 threads, 2000 ops, debug off"
103 #$TIME $PDSH $CLIENTS "umask 0022 && cd $RLUSTRE/tests && perl $RENAME --mountpt=${MOUNTPT} --num_mounts=-1 --iterations=2000 --num_threads=8 --silent"
104
105 display_elapsed_time