mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Adjustments
This commit is contained in:
parent
8ba93a8170
commit
69b0508d47
@ -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
|
||||
|
@ -1,21 +1,16 @@
|
||||
#!/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
|
||||
|
||||
echo -n "["
|
||||
for i in $(seq 1 $TRIES); do
|
||||
echo "{\"query\":\"$query\"}"| sed -e 's EventTime __time g' | tr -d ';' > query.json
|
||||
echo "{\"query\":\"$query\"}"| sed -e 's EventTime __time g' | tr -d ';' > query.json
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user