Skip to content

Instantly share code, notes, and snippets.

@kmuthukk
Last active August 15, 2022 21:34
Show Gist options
  • Save kmuthukk/5cd2525d220fabd6b6ef6e1ff05bc2f5 to your computer and use it in GitHub Desktop.
Save kmuthukk/5cd2525d220fabd6b6ef6e1ff05bc2f5 to your computer and use it in GitHub Desktop.
Driver script for wide_rows.sql program to start a RF=1 cluster with desired settings, load data, flush/compact files and extract SST file sizes.
my_script() {
echo "================================="
echo "Running with ysql_enable_packed_row=$1 and compression_type=$2"
./bin/yb-ctl stop
./bin/yb-ctl start --listen_ip=0.0.0.0 --tserver_flags="ysql_enable_packed_row=$1,compression_type=$2"
python ~/notes/wide_rows.py --num_write_threads $3 --num_rows_per_thread $4 --num_columns_per_row $5 $6
./bin/yb-ts-cli -server_address=$IP:9100 flush_all_tablets
./bin/yb-ts-cli -server_address=$IP:9100 compact_all_tablets
echo "Results for packed_row=$1;compression=$2; columns=$5; threads=$3; rows_per_thread=$4; UDT=$6"
curl -s http://$IP:9000/prometheus-metrics | grep -E "(current_version_sst_|current_version_num_)" | grep -w my_table | sed 's/{.*}//g' | awk '{print $1 " = " $2}'
echo "================================="
echo "================================="
}
# Args: packed?, compression, num_threads, num_rows_per_thread, num_columns_per_row, use_udt?
my_script false Snappy 4 500 1000
my_script false Zlib 4 500 1000
my_script false Snappy 4 500 1000 --use_udt
my_script false Zlib 4 500 1000 --use_udt
my_script true Snappy 4 500 1000
my_script true Zlib 4 500 1000
@kmuthukk
Copy link
Author

kmuthukk commented Aug 15, 2022

The script wide_rows.py used in this shell script can be found here: https://gist.github.com/kmuthukk/6280d3e0a88ee7ef4b352912d7720a49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment