Daily benchmark #1067
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Daily benchmark | |
on: | |
schedule: | |
- cron: "0 12 * * *" | |
jobs: | |
benchmark: | |
strategy: | |
fail-fast: false | |
matrix: | |
disk: | |
- 1 | |
- 0 | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18.x | |
- name: Setup dependencies | |
run: | | |
sudo add-apt-repository ppa:dqlite/dev -y | |
sudo apt update | |
sudo apt install -y libsqlite3-dev libuv1-dev liblz4-dev libraft-dev libdqlite-dev | |
- name: Build & Benchmark | |
env: | |
CGO_LDFLAGS_ALLOW: "-Wl,-z,now" | |
GO_DQLITE_MULTITHREAD: 1 | |
run: | | |
go get -t -tags libsqlite3 ./... | |
go install -tags libsqlite3 github.com/canonical/go-dqlite/cmd/dqlite-benchmark | |
diskmode=$(if [ ${{ matrix.disk }} -eq 1 ]; then echo -n "--disk"; fi) | |
dqlite-benchmark --db 127.0.0.1:9001 --duration 3600 --driver $diskmode --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 --workload kvreadwrite & | |
masterpid=$! | |
dqlite-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 & | |
dqlite-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 & | |
wait $masterpid | |
echo "Write results:" | |
head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-exec-* | |
echo "" | |
echo "Read results:" | |
head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-query-* | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dqlite-daily-benchmark | |
path: /tmp/dqlite-benchmark/127.0.0.1:9001/results/* |