Merge "Change PTL informatin in INFO"
[bottlenecks.git] / testsuites / rubbos / rubbos_scripts / 1-1-1 / rubbos_conf / rubbos-servletsBO.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 ###############################################################################
12 #
13 # This script runs first the RUBBoS browsing mix, then the read/write mix 
14 # for each rubbos.properties_XX specified where XX is the number of emulated
15 # clients. Note that the rubbos.properties_XX files must be configured
16 # with the corresponding number of clients.
17 # In particular set the following variables in rubis.properties_XX:
18 # httpd_use_version = Servlets
19 # workload_number_of_clients_per_node = XX/number of client machines
20 # workload_transition_table = yourPath/RUBBoS/workload/transitions.txt 
21 #
22 # This script should be run from the RUBBoS/bench directory on the local 
23 # client machine. 
24 # Results will be generated in the RUBBoS/bench directory.
25 #
26 ################################################################################
27
28 #setenv SERVLETDIR $RUBBOS_HOME/Servlets
29
30 set -x
31
32 # Go back to RUBBoS root directory
33 cd ..
34
35 export scp_options='-o StrictHostKeyChecking=no -o BatchMode=yes'
36
37 # Browse only
38
39 cp -fin ./workload/browse_only_transitions.txt ./workload/user_transitions.txt
40 cp -fin ./workload/browse_only_transitions.txt ./workload/author_transitions.txt
41
42 for host in ${CLIENT1_HOST} ${CLIENT2_HOST} ${CLIENT3_HOST} ${CLIENT4_HOST}
43 do
44     scp ${scp_options} ./workload/browse_only_transitions.txt ${host}:${RUBBOS_HOME}/workload/user_transitions.txt
45     scp ${scp_options} ./workload/browse_only_transitions.txt ${host}:${RUBBOS_HOME}/workload/author_transitions.txt
46     scp ${scp_options} Client/rubbos.properties ${host}:${RUBBOS_HOME}/Client/rubbos.properties
47 done
48
49 #bench/flush_cache 490000
50 #ssh $HTTPD_HOST "$RUBBOS_HOME/bench/flush_cache 880000"       # web server
51 #ssh $MYSQL1_HOST "$RUBBOS_HOME/bench/flush_cache 880000"       # database server
52 #ssh $TOMCAT1_HOST "$RUBBOS_HOME/bench/flush_cache 780000"       # servlet server
53 #ssh $CLIENT1_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
54 #ssh $CLIENT2_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
55 #ssh $CLIENT3_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
56 #ssh $CLIENT4_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
57
58 RAMPUP=48000
59 MI=72000
60 current_seconds=`date +%s`
61 start_seconds=`echo \( $RAMPUP / 1000 \) + $current_seconds - 60 | bc`
62 SMI=`date -d "1970-01-01 $start_seconds secs UTC" +%Y%m%d%H%M%S`
63 end_seconds=`echo \( $RAMPUP / 1000 + $MI / 1000 + 30 \) + $current_seconds | bc`
64 EMI=`date -d "1970-01-01 $end_seconds secs UTC" +%Y%m%d%H%M%S`
65
66 for host in $BENCHMARK_HOST $CLIENT1_HOST $CLIENT2_HOST $CLIENT3_HOST \
67             $CLIENT4_HOST $HTTPD_HOST $TOMCAT1_HOST $MYSQL1_HOST
68 do
69     ssh $scp_options $host "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
70 done
71
72 echo "Rubbos emulator start $(date)"
73 make emulator
74 echo "Rubbos emulator end $(date)"
75
76 set -x
77