Skip to content

Commit

Permalink
Break scale up workload into two parts
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Nov 14, 2023
1 parent 50316f1 commit a4aa1d5
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 0 deletions.
42 changes: 42 additions & 0 deletions experiments/15-e2e-scenarios-v2/scale_up/COND
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,45 @@ run_command(
"dataset-type": "100gb",
},
)

run_experiment(
name="brad_100g_txn_up",
run="./run_workload_txn_up.sh",
options={
# TODO: Ideally, configurations are shared. Only keep AWS secrets separate.
"config-file": "config/config_large_100.yml",
"planner-config-file": "config/planner.yml",
"schema-name": "imdb_extended_100g",
"ra-query-bank-file": IMDB_100GB_REGULAR_QUERY_BANK,
"num-front-ends": 28,
"dataset-type": "100gb",
},
)

run_experiment(
name="brad_100g_ana_up",
run="./run_workload_ana_up.sh",
options={
# TODO: Ideally, configurations are shared. Only keep AWS secrets separate.
"config-file": "config/config_large_100.yml",
"planner-config-file": "config/planner.yml",
"schema-name": "imdb_extended_100g",
"ra-query-bank-file": IMDB_100GB_REGULAR_QUERY_BANK,
"num-front-ends": 28,
"dataset-type": "100gb",
},
)

run_command(
name="brad_100g_warmup",
run="./run_overall_warmup.sh",
options={
# TODO: Ideally, configurations are shared. Only keep AWS secrets separate.
"config-file": "config/config_large_100.yml",
"planner-config-file": "config/planner.yml",
"schema-name": "imdb_extended_100g",
"ra-query-bank-file": IMDB_100GB_REGULAR_QUERY_BANK,
"num-front-ends": 28,
"dataset-type": "100gb",
},
)
37 changes: 37 additions & 0 deletions experiments/15-e2e-scenarios-v2/scale_up/run_overall_warmup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /bin/bash
script_loc=$(cd $(dirname $0) && pwd -P)
cd $script_loc
source ../common.sh

initial_queries="99,56,32,92,91,49,30,83,94,38,87,86,76,37,31,46"
heavier_queries="58,61,62,64,69,73,74,51,57,60"

# Arguments:
# --config-file
# --planner-config-file
# --query-indexes
extract_named_arguments $@

function inner_cancel_experiment() {
cancel_experiment $rana_pid $txn_pid
}

trap "inner_cancel_experiment" INT
trap "inner_cancel_experiment" TERM

# Used just to warm up the systems.

export BRAD_IGNORE_BLUEPRINT=1
start_brad_debug $config_file $planner_config_file
sleep 30

start_repeating_olap_runner 1 5 5 $initial_queries "ra_8"
rana_pid=$runner_pid
sleep 2

log_workload_point "start_txn_2"
start_txn_runner 2
txn_pid=$runner_pid

sleep $((5 * 60))
graceful_shutdown $rana_pid $txn_pid
90 changes: 90 additions & 0 deletions experiments/15-e2e-scenarios-v2/scale_up/run_workload_ana_up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#! /bin/bash

script_loc=$(cd $(dirname $0) && pwd -P)
cd $script_loc
source ../common.sh

initial_queries="99,56,32,92,91,49,30,83,94,38,87,86,76,37,31,46"
heavier_queries="58,61,62,64,69,73,74,51,57,60"

# Arguments:
# --config-file
# --planner-config-file
# --query-indexes
extract_named_arguments $@

function txn_sweep() {
local sweep=$1
local gap_minute=$2
local keep_last=$3

for t_clients in $sweep; do
start_txn_runner $t_clients # Implicit: --dataset-type
txn_pid=$runner_pid

sleep $(($gap_minute * 60))
if [[ -z $keep_last ]] || [[ $t_clients != $keep_last ]]; then
kill -INT $txn_pid
wait $txn_pid
fi
done
}

function rana_sweep_offset4() {
local sweep=$1
local gap_minute=$2
local keep_last=$3
local query_indices=$4

for ra_clients in $sweep; do
start_repeating_olap_runner $ra_clients 15 5 $query_indices "ra_${ra_clients}" 4
sweep_rana_pid=$runner_pid

sleep $(($gap_minute * 60))
if [[ -z $keep_last ]] || [[ $ra_clients != $keep_last ]]; then
kill -INT $sweep_rana_pid
wait $sweep_rana_pid
fi
done
}

function inner_cancel_experiment() {
if [ ! -z $heavy_rana_pid ]; then
cancel_experiment $rana_pid $txn_pid $heavy_rana_pid
else
cancel_experiment $rana_pid $txn_pid
fi
}

trap "inner_cancel_experiment" INT
trap "inner_cancel_experiment" TERM

start_brad $config_file $planner_config_file
log_workload_point "brad_start_initiated"
sleep 30

# Start with 4 light analytical clients.
log_workload_point "start_rana_4"
start_repeating_olap_runner 4 15 5 $initial_queries "ra_4"
rana_pid=$runner_pid
log_workload_point "started_rana_4_$rana_pid"
sleep 2

# Start with 8 transactional clients; hold for 10 minutes to stabilize.
log_workload_point "start_txn_4"
start_txn_runner 4
txn_pid=$runner_pid
sleep $((10 * 60))

# Scale up to 28 analytical clients in total (24 heavy).
log_workload_point "start_increase_rana_heavy_4_to_24"
rana_sweep_offset4 "4 8 12 16 20 24" 3 24 $heavier_queries
log_workload_point "hold_rana_heavy_24"
sleep $((30 * 60)) # 18 + 30 mins; 58 cumulative

log_workload_point "experiment_workload_done"

# Shut down everything now.
>&2 echo "Experiment done. Shutting down runners..."
graceful_shutdown $rana_pid $heavy_rana_pid $txn_pid
log_workload_point "shutdown_complete"
85 changes: 85 additions & 0 deletions experiments/15-e2e-scenarios-v2/scale_up/run_workload_txn_up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#! /bin/bash

script_loc=$(cd $(dirname $0) && pwd -P)
cd $script_loc
source ../common.sh

# Scenario:
# - Start from 2x t4g.medium Aurora, Redshift off
# - 4 T clients, increasing to 24 T clients by 4 every minute
# We expect BRAD to scale up Aurora at this point, but not start Redshift (a replica should be fine for the analytical workload)
# - Increase the analytical load + add new "heavier" queries - expect that these go to Athena
# - Increase frequency of queries, expect Redshift to start (go straight to 2x dc2.large to avoid classic resize for practical purposes)

# TODO: This executor file should be adapted to run against the baselines too
# (TiDB / Serverless Redshift + Aurora)

initial_queries="99,56,32,92,91,49,30,83,94,38,87,86,76,37,31,46"
heavier_queries="58,61,62,64,69,73,74,51,57,60"

# Arguments:
# --config-file
# --planner-config-file
# --query-indexes
extract_named_arguments $@

function txn_sweep() {
local sweep=$1
local gap_minute=$2
local keep_last=$3

for t_clients in $sweep; do
start_txn_runner $t_clients # Implicit: --dataset-type
txn_pid=$runner_pid

sleep $(($gap_minute * 60))
if [[ -z $keep_last ]] || [[ $t_clients != $keep_last ]]; then
kill -INT $txn_pid
wait $txn_pid
fi
done
}

function inner_cancel_experiment() {
if [ ! -z $heavy_rana_pid ]; then
cancel_experiment $rana_pid $txn_pid $heavy_rana_pid
else
cancel_experiment $rana_pid $txn_pid
fi
}

trap "inner_cancel_experiment" INT
trap "inner_cancel_experiment" TERM

start_brad $config_file $planner_config_file
log_workload_point "brad_start_initiated"
sleep 30

# Start with Aurora 2x db.t4g.medium, Redshift off, Athena unused.

# Start with 4 analytical clients.
log_workload_point "start_rana_4"
start_repeating_olap_runner 4 15 5 $initial_queries "ra_4"
rana_pid=$runner_pid
log_workload_point "started_rana_4_$rana_pid"
sleep 2

# Start with 4 transactional clients; hold for 15 minutes to stabilize.
log_workload_point "start_txn_4"
start_txn_runner 4
txn_pid=$runner_pid
sleep $((10 * 60)) # 10 mins; 10 mins cumulative

# Scale up to 8 transactional clients and hold for 30 minutes.
log_workload_point "start_increase_txn_4_to_8"
kill -INT $txn_pid
wait $txn_pid
txn_sweep "5 6 7 8" 3 8
log_workload_point "hold_txn_8_20_min"
sleep $((35 * 60)) # 47 mins total; 57 mins cumulative

# Shut down everything now.
log_workload_point "experiment_workload_done"
>&2 echo "Experiment done. Shutting down runners..."
graceful_shutdown $rana_pid $heavy_rana_pid $txn_pid
log_workload_point "shutdown_complete"

0 comments on commit a4aa1d5

Please sign in to comment.