-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Providing Scripts for Cassandra's Warmup and Test (#398)
* New script for loading and warming up the server * Make parameters alternative.
- Loading branch information
Showing
4 changed files
with
87 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Usage: load.sh <server_ip> <record_count> <target_load> <threads=1> <operation_count=load * 60> | ||
|
||
if [ -z $4 ]; then | ||
THREADS=1 | ||
else | ||
THREADS=$4 | ||
fi | ||
|
||
if [ -z $5 ]; then | ||
let OP_COUNT="60*$3" | ||
else | ||
OP_COUNT=$5 | ||
fi | ||
|
||
|
||
echo '======================================================' | ||
echo "server IP: $1" | ||
echo "Database record count: $2" | ||
echo "Target load: $3 rps" | ||
echo "Loader threads count: $THREADS" | ||
echo "Opeartion count: $OP_COUNT" | ||
echo "Make sure you have run the warmup.sh before loading the server, and use the same record count here." | ||
echo '======================================================' | ||
|
||
/ycsb/bin/ycsb run cassandra-cql -p hosts=$1 -P /ycsb/workloads/workloada \ | ||
-p recordcount=$2 -p operationcount=$OP_COUNT \ | ||
-threads $THREADS -target $3 -s | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# This script helps to fill the server database with given data set size. | ||
# Usage: warmup.sh <server_ip> <record_count> <threads=1> | ||
# Each record takes 1KB to store, so if you want a 10GB database, just giving 10M records. | ||
|
||
if [ -z $3 ]; then | ||
THREADS=1 | ||
else | ||
THREADS=$3 | ||
fi | ||
|
||
echo '======================================================' | ||
echo "server IP: $1" | ||
echo "Fill the database with $2 records" | ||
echo "Load generator threads count: $THREADS" | ||
echo '======================================================' | ||
|
||
|
||
|
||
echo '======================================================' | ||
echo 'Creating a usertable for the seed server' | ||
echo '======================================================' | ||
|
||
first_server=$(cut -d',' -f1 <<< "$1") | ||
|
||
exit=0 | ||
while [ $exit -eq 0 ]; do | ||
set +e | ||
cqlsh -f /setup_tables.txt $first_server | ||
if [[ "$?" -eq 0 ]]; then | ||
exit=1 | ||
else | ||
echo 'Cannot connect to the seed server. Trying again...' | ||
fi | ||
set -e | ||
sleep 5 | ||
done | ||
|
||
echo '======================================================' | ||
echo 'Populate the database' | ||
echo '======================================================' | ||
|
||
/ycsb/bin/ycsb load cassandra-cql -p hosts=$1 -P /ycsb/workloads/workloada -p recordcount=$2 -s -threads $THREADS | ||
|
||
echo '======================================================' | ||
echo 'Warm up is done.' | ||
echo '======================================================' | ||
|
||
|