ClickHouse/benchmark/questdb/benchmark.sh

30 lines
1.0 KiB
Bash
Raw Normal View History

2022-06-26 05:31:49 +00:00
#!/bin/bash
# Install
wget https://github.com/questdb/questdb/releases/download/6.4.1/questdb-6.4.1-rt-linux-amd64.tar.gz
tar xf questdb*.tar.gz
questdb-6.4.1-rt-linux-amd64/bin/questdb.sh start
# Import the data
2022-06-26 21:04:19 +00:00
wget --continue 'https://datasets.clickhouse.com/hits_compatible/hits.csv.gz'
2022-06-26 05:59:40 +00:00
gzip -d hits.csv.gz
2022-06-26 05:31:49 +00:00
curl -G --data-urlencode "query=$(cat create.sql)" 'http://localhost:9000/exec?timings=true'
time curl -F data=@hits.csv 'http://localhost:9000/imp?name=hits'
2022-06-26 05:59:40 +00:00
2022-06-26 07:30:59 +00:00
# 27m 47.546s
2022-06-26 17:42:50 +00:00
sed -i 's/query.timeout.sec=60/query.timeout.sec=6000/' .questdb/conf/server.conf
questdb-6.4.1-rt-linux-amd64/bin/questdb.sh stop
questdb-6.4.1-rt-linux-amd64/bin/questdb.sh start
2022-06-26 07:30:59 +00:00
./run.sh 2>&1 | tee log.txt
2022-06-26 08:14:00 +00:00
du -bcs .questdb/db/hits
2022-06-26 21:25:39 +00:00
cat log.txt | grep -P '"timings"|"error"|null' | sed -r -e 's/^.*"error".*$/null/; s/^.*"compiler":([0-9]*),"execute":([0-9]*),.*$/\1 \2/' |
2022-06-26 21:04:19 +00:00
awk '{ print ($1 + $2) / 1000000000 }' | sed -r -e 's/^0$/null/' |
2022-06-26 08:14:00 +00:00
awk '{ if (i % 3 == 0) { printf "[" }; printf $1; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }'