From 60b6eecc7a81ad7438c3de013ee7a117c1eb7dce Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 28 Jan 2021 16:36:45 -0700 Subject: [PATCH] Update keyed/unkeyed benchmarks --- scripts/bench_read.sh | 2 +- scripts/bench_write.sh | 27 +++++++++++++----------- scripts/etc/gloat/gh.issues.keyed.yml | 9 ++++++++ scripts/etc/gloat/gh.issues.unkeyed.yml | 9 ++++++++ scripts/etc/gloat/query.count.keyed.yml | 11 ++++++++++ scripts/populate_query_db.keyed.sh | 28 +++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 scripts/etc/gloat/gh.issues.keyed.yml create mode 100644 scripts/etc/gloat/gh.issues.unkeyed.yml create mode 100644 scripts/etc/gloat/query.count.keyed.yml create mode 100755 scripts/populate_query_db.keyed.sh diff --git a/scripts/bench_read.sh b/scripts/bench_read.sh index a070bfb94..f2ad4d96f 100755 --- a/scripts/bench_read.sh +++ b/scripts/bench_read.sh @@ -21,7 +21,7 @@ SHA=$(git -C $PILOSA_SRC rev-parse HEAD) # Format current date. DATE=$(date '+%Y%m%d') -for TYPE in row row-bsi row-range count intersect union difference xor groupby topk +for TYPE in row row-bsi row-range count count-keyed intersect union difference xor groupby topk do WORKFLOW_PATH="${BASH_SOURCE%/*}/etc/gloat/query.${TYPE}.yml" WORKFLOW_NAME="$(gloat workflow name $WORKFLOW_PATH)" diff --git a/scripts/bench_write.sh b/scripts/bench_write.sh index 02e8067ca..a5306debc 100755 --- a/scripts/bench_write.sh +++ b/scripts/bench_write.sh @@ -21,19 +21,22 @@ SHA=$(git -C $PILOSA_SRC rev-parse HEAD) # Format current date. DATE=$(date '+%Y%m%d') -WORKFLOW_PATH="${BASH_SOURCE%/*}/etc/gloat/gh.1m.yml" -WORKFLOW_NAME="$(gloat workflow name $WORKFLOW_PATH)" -TITLE="RBF vs Roaring, $WORKFLOW_NAME, $DATE ($SHA)" +for FILENAME in gh.1m.yml gh.issues.keyed.yml gh.issues.unkeyed.yml +do + WORKFLOW_PATH="${BASH_SOURCE%/*}/etc/gloat/${FILENAME}" + WORKFLOW_NAME="$(gloat workflow name $WORKFLOW_PATH)" + TITLE="RBF vs Roaring, $WORKFLOW_NAME, $DATE ($SHA)" -# Execute RBF/Roaring benchmark. -RBF_PATH=gloat/data/1m/rbf/${DATE}.tar.gz -TXSRC=rbf gloat run -v -o $RBF_PATH $WORKFLOW_PATH + # Execute RBF/Roaring benchmark. + RBF_PATH=gloat/data/1m/rbf/${DATE}.tar.gz + TXSRC=rbf gloat run -v -o $RBF_PATH $WORKFLOW_PATH -ROARING_PATH=gloat/data/1m/roaring/${DATE}.tar.gz -TXSRC=roaring gloat run -v -o $ROARING_PATH $WORKFLOW_PATH + ROARING_PATH=gloat/data/1m/roaring/${DATE}.tar.gz + TXSRC=roaring gloat run -v -o $ROARING_PATH $WORKFLOW_PATH -# Generate graph from results. -gloat graph -layout 2,5 -size 5120,820 -title "$TITLE" -name utime,stime,heap_alloc,heap_inuse,heap_objects,num_gc,rchar,wchar,syscr,syscw -series rbf,roaring -o /tmp/output.png $RBF_PATH $ROARING_PATH + # Generate graph from results. + gloat graph -layout 2,5 -size 5120,820 -title "$TITLE" -name utime,stime,heap_alloc,heap_inuse,heap_objects,num_gc,rchar,wchar,syscr,syscw -series rbf,roaring -o /tmp/output.png $RBF_PATH $ROARING_PATH -# Post graph to Slack with SHA. -curl -F file=@/tmp/output.png -F channels=C01HBFKRLGH -F "initial_comment=$TITLE" -H "Authorization: Bearer $SLACK_OAUTH_TOKEN" https://slack.com/api/files.upload + # Post graph to Slack with SHA. + curl -F file=@/tmp/output.png -F channels=C01HBFKRLGH -F "initial_comment=$TITLE" -H "Authorization: Bearer $SLACK_OAUTH_TOKEN" https://slack.com/api/files.upload +done \ No newline at end of file diff --git a/scripts/etc/gloat/gh.issues.keyed.yml b/scripts/etc/gloat/gh.issues.keyed.yml new file mode 100644 index 000000000..215f7f0d3 --- /dev/null +++ b/scripts/etc/gloat/gh.issues.keyed.yml @@ -0,0 +1,9 @@ +name: "GitHub Issues Import Load Testing (1 month, keyed)" + +main: "pilosa server --data-dir ${TMPDIR} --txsrc ${TXSRC}" +load: "molecula-consumer-github -i issues -r url --record-type issue --batch-size=100000 --start-time 2020-01-01T00:00:00Z --end-time 2020-01-13T23:00:00Z --cache-dir ~/.githubarchive" + +health_url: "http://localhost:10101/status" +vars_urls: + - http://localhost:10101/debug/vars + - http://localhost:7070/debug/vars diff --git a/scripts/etc/gloat/gh.issues.unkeyed.yml b/scripts/etc/gloat/gh.issues.unkeyed.yml new file mode 100644 index 000000000..45bbb7650 --- /dev/null +++ b/scripts/etc/gloat/gh.issues.unkeyed.yml @@ -0,0 +1,9 @@ +name: "GitHub Issues Import Load Testing (1 month, unkeyed)" + +main: "pilosa server --data-dir ${TMPDIR} --txsrc ${TXSRC}" +load: "molecula-consumer-github -i issues -d id --record-type issue --batch-size=100000 --start-time 2020-01-01T00:00:00Z --end-time 2020-01-13T23:00:00Z --cache-dir ~/.githubarchive" + +health_url: "http://localhost:10101/status" +vars_urls: + - http://localhost:10101/debug/vars + - http://localhost:7070/debug/vars diff --git a/scripts/etc/gloat/query.count.keyed.yml b/scripts/etc/gloat/query.count.keyed.yml new file mode 100644 index 000000000..3d0eb49b3 --- /dev/null +++ b/scripts/etc/gloat/query.count.keyed.yml @@ -0,0 +1,11 @@ +name: "Count() Load Testing w/ Keys" + +main: "pilosa server --data-dir ~/pilosa.query.keyed.${TXSRC} --txsrc ${TXSRC}" +load: "pilosa-bench -type count -rate 100 -n 3000" + +health_url: "http://localhost:10101/status" +health_regexp: "NORMAL" + +vars_urls: + - http://localhost:10101/debug/vars + - http://localhost:7070/debug/vars diff --git a/scripts/populate_query_db.keyed.sh b/scripts/populate_query_db.keyed.sh new file mode 100755 index 000000000..5476d54b8 --- /dev/null +++ b/scripts/populate_query_db.keyed.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +# This script generates data query load testing to be run against. +# +# Environment variables: +# - TXSRC: Transaction store type ("roaring", "rbf") +# - CACHEDIR: Path to local GitHub Archive data, if available. + +# Require environment variables. +: "${TXSRC:?Must set TXSRC environment variable}" +: "${GHCACHEDIR:''}" + +echo "Starting pilosa" +pilosa server --data-dir ~/pilosa.query.keyed.${TXSRC} --txsrc ${TXSRC} & pid_pilosa=$! +sleep 5 + +echo "" +echo "Importing GitHub Archive" +molecula-consumer-github -i issues -r url --record-type issue --batch-size=100000 \ + --start-time 2020-01-01T00:00:00Z --end-time 2020-01-31T23:00:00Z \ + --cache-dir "$GHCACHEDIR" + +echo "" +echo "Import complete, shutting down pilosa" + +sleep 5 +kill $pid_pilosa