Adjustments

This commit is contained in:
Alexey Milovidov 2022-07-01 00:15:17 +02:00
parent 8ba93a8170
commit 69b0508d47
2 changed files with 11 additions and 12 deletions

View File

@ -1,17 +1,20 @@
#!/bin/bash
# If you have no java installed:
# sudo apt-get update
# sudo apt install openjdk-8-jdk -y
# sudo update-alternatives --config java
sudo apt-get update
sudo apt install openjdk-8-jdk -y
sudo update-alternatives --config java
# Install
VERSION=0.23.0
# Install
wget -O"apache-druid-${VERSION}-bin.tar.gz" "https://dlcdn.apache.org/druid/${VERSION}/apache-druid-${VERSION}-bin.tar.gz"
tar xf apache-druid-${VERSION}-bin.tar.gz
./apache-druid-${VERSION}/bin/verify-java
# Have to increase indexer memory limit
sed -i 's MaxDirectMemorySize=1g MaxDirectMemorySize=5g g' apache-druid-$VERSION/conf/druid/single-server/medium/middleManager/runtime.properties
# Druid launcher does not start Druid as a daemon. Run it in background
./apache-druid-${VERSION}/bin/start-single-server-medium &
@ -20,10 +23,11 @@ sed -i 's MaxDirectMemorySize=1g MaxDirectMemorySize=5g g' apache-druid-$VERSION
wget --continue 'https://datasets.clickhouse.com/hits_compatible/hits.tsv.gz'
gzip -d hits.tsv.gz
split --additional-suffix .tsv --verbose -n l/10 hits.tsv input
# Running 10 tasks one by one to make it work in parallel
./apache-druid-${VERSION}/bin/post-index-task --file ingest.json --url http://localhost:8081
# Run the queries
# Run the queries
./run.sh
# stop Druid services

View File

@ -1,7 +1,6 @@
#!/bin/bash
TRIES=3
QUERY_NUM=1
cat queries.sql | while read query; do
sync
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null
@ -12,10 +11,6 @@ cat queries.sql | while read query; do
RES=$(curl -o /dev/null -s -w '%{time_total}\n' -XPOST -H'Content-Type: application/json' http://localhost:8888/druid/v2/sql/ -d @query.json)
[[ "$?" == "0" ]] && echo -n "${RES}" || echo -n "null"
[[ "$i" != $TRIES ]] && echo -n ", "
echo "${QUERY_NUM},${i},${RES}" >> result.csv
done
echo "],"
QUERY_NUM=$((QUERY_NUM + 1))
done