Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Create a docker image with benchmark tooling #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docker/tidb-bench/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.12.1-alpine3.9 AS goycsb

RUN apk add git build-base \
&& git clone https://github.com/pingcap/go-ycsb $GOPATH/src/github.com/pingcap/go-ycsb \
&& cd $GOPATH/src/github.com/pingcap/go-ycsb \
&& make

FROM alpine:3.9
MAINTAINER PingCAP <[email protected]>

COPY --from=pingcap/tidb-sysbench /usr/local/bin/sysbench /usr/local/bin/sysbench
COPY --from=pingcap/tidb-sysbench /usr/local/share/sysbench /usr/local/share/sysbench

COPY --from=dmonakhov/alpine-fio /usr/local/bin/fio /usr/local/bin/fio

COPY --from=goycsb /go/src/github.com/pingcap/go-ycsb/bin/go-ycsb /go-ycsb/bin/go-ycsb
COPY --from=goycsb /go/src/github.com/pingcap/go-ycsb/workloads /go-ycsb/workloads
COPY --from=goycsb /go/src/github.com/pingcap/go-ycsb/tool /go-ycsb/tool

ADD README.md /README.md

CMD ["bash"]
54 changes: 54 additions & 0 deletions docker/tidb-bench/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
This image includes various utilities used to benchmark TiDB.

# Performance tests

* sysbench
* go-ycsb


# Disk tests

*Note:* All the commands need to be run under the disk mount point. And the test.data file need to be deleted before test.

## fio
* Read
```
fio -ioengine=libaio -bs=32k -direct=1 -thread -rw=read -size=10G -filename=test.data -name="PingCAP max throughput" -iodepth=4 -runtime=60
```

* Write
```
fio -ioengine=libaio -bs=32k -direct=1 -thread -rw=write -size=10G -filename=test.data -name="PingCAP max throughput" -iodepth=4 -runtime=60
```

* Random read
```
fio -ioengine=libaio -bs=32k -direct=1 -thread -rw=randread -size=10G -filename=test.data -name="PingCAP max throughput" -iodepth=4 -runtime=60
```

* Random write
```
fio -ioengine=libaio -bs=32k -direct=1 -thread -rw=randwrite -size=10G -filename=test.data -name="PingCAP max throughput" -iodepth=4 -runtime=60
```

* Random read & write
```
fio -ioengine=libaio -bs=32k -direct=1 -thread -rw=randrw -percentage_random=100,0 -size=10G -filename=test.data -name="PingCAP max throughput" -iodepth=4 -runtime=60
```

## dd

* Cache write
```
dd bs=4k count=400000 if=/dev/zero of=test.data
```

* Direct write
```
dd bs=4k count=400000 if=/dev/zero of=test.data oflag=direct
```

* Direct read
```
dd bs=4k count=400000 if=test.data of=/dev/null& oflag=direct
```
6 changes: 6 additions & 0 deletions docker/tidb-bench/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
pushd ../tidb-sysbench
./build.sh
popd
docker build -t pingcap/tidb-bench .