62c3c6cbbb7797f2081904a5b78ace47e683eb9d
[bottlenecks.git] / rubbos / rubbos_scripts / 1-1-1 / rubbos_conf / rubbos-servletsBO.sh
1 #!/bin/bash
2
3 ###############################################################################
4 #
5 # This script runs first the RUBBoS browsing mix, then the read/write mix 
6 # for each rubbos.properties_XX specified where XX is the number of emulated
7 # clients. Note that the rubbos.properties_XX files must be configured
8 # with the corresponding number of clients.
9 # In particular set the following variables in rubis.properties_XX:
10 # httpd_use_version = Servlets
11 # workload_number_of_clients_per_node = XX/number of client machines
12 # workload_transition_table = yourPath/RUBBoS/workload/transitions.txt 
13 #
14 # This script should be run from the RUBBoS/bench directory on the local 
15 # client machine. 
16 # Results will be generated in the RUBBoS/bench directory.
17 #
18 ################################################################################
19
20 #setenv SERVLETDIR $RUBBOS_HOME/Servlets
21
22 set -x
23
24 # Go back to RUBBoS root directory
25 cd ..
26
27 export scp_options='-o StrictHostKeyChecking=no -o BatchMode=yes'
28
29 # Browse only
30
31 cp -fin ./workload/browse_only_transitions.txt ./workload/user_transitions.txt
32 cp -fin ./workload/browse_only_transitions.txt ./workload/author_transitions.txt
33
34 for host in ${CLIENT1_HOST} ${CLIENT2_HOST} ${CLIENT3_HOST} ${CLIENT4_HOST}
35 do
36     scp ${scp_options} ./workload/browse_only_transitions.txt ${host}:${RUBBOS_HOME}/workload/user_transitions.txt
37     scp ${scp_options} ./workload/browse_only_transitions.txt ${host}:${RUBBOS_HOME}/workload/author_transitions.txt
38     scp ${scp_options} Client/rubbos.properties ${host}:${RUBBOS_HOME}/Client/rubbos.properties
39 done
40
41 #bench/flush_cache 490000
42 #ssh $HTTPD_HOST "$RUBBOS_HOME/bench/flush_cache 880000"       # web server
43 #ssh $MYSQL1_HOST "$RUBBOS_HOME/bench/flush_cache 880000"       # database server
44 #ssh $TOMCAT1_HOST "$RUBBOS_HOME/bench/flush_cache 780000"       # servlet server
45 #ssh $CLIENT1_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
46 #ssh $CLIENT2_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
47 #ssh $CLIENT3_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
48 #ssh $CLIENT4_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
49
50 RAMPUP=480000
51 MI=720000
52 current_seconds=`date +%s`
53 start_seconds=`echo \( $RAMPUP / 1000 \) + $current_seconds - 60 | bc`
54 SMI=`date -d "1970-01-01 $start_seconds secs UTC" +%Y%m%d%H%M%S`
55 end_seconds=`echo \( $RAMPUP / 1000 + $MI / 1000 + 30 \) + $current_seconds | bc`
56 EMI=`date -d "1970-01-01 $end_seconds secs UTC" +%Y%m%d%H%M%S`
57
58 for host in $BENCHMARK_HOST $CLIENT1_HOST $CLIENT2_HOST $CLIENT3_HOST \
59             $CLIENT4_HOST $HTTPD_HOST $TOMCAT1_HOST $MYSQL1_HOST
60 do
61     ssh $scp_options $host "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
62 done
63
64 make emulator
65
66 set -x
67