From 79c154d8be98402c4a0a3917d180d5b234f57bd0 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Mon, 22 Apr 2024 12:05:56 +0000 Subject: [PATCH 1/2] Changed namespace --- mongodb-benchmarking.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongodb-benchmarking.yaml b/mongodb-benchmarking.yaml index 69485d7..23e3744 100644 --- a/mongodb-benchmarking.yaml +++ b/mongodb-benchmarking.yaml @@ -5,7 +5,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: mongodb-benchmarking - namespace: perf-test + namespace: benchmarking labels: app: mongodb-benchmarking spec: From 1f7f01626a948713c5ce91409f01a80d22908ee9 Mon Sep 17 00:00:00 2001 From: Dmitry Ratushnyy Date: Mon, 22 Apr 2024 12:37:22 +0000 Subject: [PATCH 2/2] Update ycsb scriptts --- scripts/ycsb_load_data.sh | 28 +++++++++++++++++----------- scripts/ycsb_run_operations.sh | 23 +++++++++++++---------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/scripts/ycsb_load_data.sh b/scripts/ycsb_load_data.sh index 85707eb..02ae897 100644 --- a/scripts/ycsb_load_data.sh +++ b/scripts/ycsb_load_data.sh @@ -5,21 +5,27 @@ ln -sf /usr/bin/python2.7 /usr/bin/python export PATH="/usr/lib/jvm/java-21-openjdk-amd64/bin/:/usr/share/maven/bin/:$PATH" # Default values -RECORD_COUNT_DEFAULT=500000 -LOAD_THREADS_COUNT_DEFAULT=16 -MONGODB_URI_DEFAULT="mongodb://localhost:21017/admin?replicaSet=mongodb" -WORKLOAD_DEFAULT="workloada" +RECORD_COUNT=500000 +LOAD_THREADS_COUNT=16 +MONGODB_URI="mongodb://localhost:21017/admin?replicaSet=mongodb-k8s" +WORKLOAD="workloada" -# Read parameters or use defaults -WORKLOAD=${1:-$WORKLOAD_DEFAULT} -RECORD_COUNT=${2:-$RECORD_COUNT_DEFAULT} -LOAD_THREADS_COUNT=${3:-$LOAD_THREADS_COUNT_DEFAULT} -MONGODB_URI=${4:-$MONGODB_URI_DEFAULT} +# Parse named arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + -w|--workload) WORKLOAD="$2"; shift ;; + -rc|--record-count) RECORD_COUNT="$2"; shift ;; + -lt|--load-threads-count) LOAD_THREADS_COUNT="$2"; shift ;; + -mu|--mongodb-uri) MONGODB_URI="$2"; shift ;; + *) echo "Unknown parameter passed: $1"; exit 1 ;; + esac + shift +done +# Run YCSB with specified parameters /var/load-testing/ycsb-0.17.0/bin/ycsb \ load mongodb -s \ -P "/var/load-testing/ycsb-0.17.0/workloads/$WORKLOAD" \ -p recordcount=$RECORD_COUNT \ -threads $LOAD_THREADS_COUNT \ - -p mongodb.url="$MONGODB_URI" - \ No newline at end of file + -p mongodb.url="$MONGODB_URI" \ No newline at end of file diff --git a/scripts/ycsb_run_operations.sh b/scripts/ycsb_run_operations.sh index f34d807..9c531ed 100644 --- a/scripts/ycsb_run_operations.sh +++ b/scripts/ycsb_run_operations.sh @@ -4,19 +4,22 @@ ln -sf /usr/bin/python2.7 /usr/bin/python export PATH="/usr/lib/jvm/java-21-openjdk-amd64/bin/:/usr/share/maven/bin/:$PATH" -# Default values OPERATIONS_COUNT=1000000 OPERATIONS_THREADS_COUNT=2 -MONGODB_URI_DEFAULT="mongodb://localhost:21017/admin?replicaSet=mongodb" -WORKLOAD_DEFAULT="workloada" - -# Read parameters or use defaults -WORKLOAD=${1:-$WORKLOAD_DEFAULT} -RECORD_COUNT=${2:-$RECORD_COUNT_DEFAULT} -LOAD_THREADS_COUNT=${3:-$LOAD_THREADS_COUNT_DEFAULT} -MONGODB_URI=${4:-$MONGODB_URI_DEFAULT} - +MONGODB_URI="mongodb://localhost:21017/admin?replicaSet=mongodb-k8s" +WORKLOAD="workloada" +# Parse named arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + -w|--workload) WORKLOAD="$2"; shift ;; + -oc|--operations-count) OPERATIONS_COUNT="$2"; shift ;; + -ot|--operations-threads-count) OPERATIONS_THREADS_COUNT="$2"; shift ;; + -mu|--mongodb-uri) MONGODB_URI="$2"; shift ;; + *) echo "Unknown parameter passed: $1"; exit 1 ;; + esac + shift +done /var/load-testing/ycsb-0.17.0/bin/ycsb \ run mongodb -s \