Merge "Change PTL informatin in INFO"
[bottlenecks.git] / testsuites / rubbos / rubbos_scripts / 1-1-1 / rubbos_conf / rubbos-servletsRW.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 # Go back to RUBBoS root directory
31 cd ..
32
33 # Read/write mix
34
35 cp --fi ./workload/user_default_transitions.txt ./workload/user_transitions.txt
36 cp --fi ./workload/author_default_transitions.txt ./workload/author_transitions.txt
37
38 scp ./workload/user_default_transitions.txt ${CLIENT1_HOST}:${RUBBOS_HOME}/workload/user_transitions.txt
39 scp ./workload/author_default_transitions.txt ${CLIENT1_HOST}:${RUBBOS_HOME}/workload/author_transitions.txt
40
41 scp ./workload/user_default_transitions.txt ${CLIENT2_HOST}:${RUBBOS_HOME}/workload/user_transitions.txt
42 scp ./workload/author_default_transitions.txt ${CLIENT2_HOST}:${RUBBOS_HOME}/workload/author_transitions.txt
43
44 scp ./workload/user_default_transitions.txt ${CLIENT3_HOST}:${RUBBOS_HOME}/workload/user_transitions.txt
45 scp ./workload/author_default_transitions.txt ${CLIENT3_HOST}:${RUBBOS_HOME}/workload/author_transitions.txt
46
47 scp ./workload/user_default_transitions.txt ${CLIENT4_HOST}:${RUBBOS_HOME}/workload/user_transitions.txt
48 scp ./workload/author_default_transitions.txt ${CLIENT4_HOST}:${RUBBOS_HOME}/workload/author_transitions.txt
49
50 scp Client/rubbos.properties ${CLIENT1_HOST}:${RUBBOS_HOME}/Client/rubbos.properties
51 scp Client/rubbos.properties ${CLIENT2_HOST}:${RUBBOS_HOME}/Client/rubbos.properties
52 scp Client/rubbos.properties ${CLIENT3_HOST}:${RUBBOS_HOME}/Client/rubbos.properties
53 scp Client/rubbos.properties ${CLIENT4_HOST}:${RUBBOS_HOME}/Client/rubbos.properties
54
55
56 bench/flush_cache 490000
57 ssh $HTTPD_HOST "$RUBBOS_HOME/bench/flush_cache 880000"       # web server
58 ssh $MYSQL1_HOST "$RUBBOS_HOME/bench/flush_cache 880000"       # database server
59 ssh $TOMCAT1_HOST "$RUBBOS_HOME/bench/flush_cache 780000"       # servlet server
60 ssh $CLIENT1_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
61 ssh $CLIENT2_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
62 ssh $CLIENT3_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
63 ssh $CLIENT4_HOST "$RUBBOS_HOME/bench/flush_cache 490000"       # remote client
64
65 RAMPUP=480000
66 MI=720000
67 current_seconds=`date +%s`
68 start_seconds=`echo \( $RAMPUP / 1000 \) + $current_seconds - 60 | bc`
69 SMI=`date -d "1970-01-01 $start_seconds secs UTC" +%Y%m%d%H%M%S`
70 end_seconds=`echo \( $RAMPUP / 1000 + $MI / 1000 + 30 \) + $current_seconds | bc`
71 EMI=`date -d "1970-01-01 $end_seconds secs UTC" +%Y%m%d%H%M%S`
72 ssh $BENCHMARK_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
73 ssh $CLIENT1_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
74 ssh $CLIENT2_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
75 ssh $CLIENT3_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
76 ssh $CLIENT4_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
77 ssh $HTTPD_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
78 ssh $TOMCAT1_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
79 ssh $MYSQL1_HOST "sudo nice -n -1 $RUBBOS_APP/cpu_mem.sh $SMI $EMI" &
80
81
82 make emulator
83