Skip to content

Commit

Permalink
Add benchmark for TiKV (#1579)
Browse files Browse the repository at this point in the history
Also add make target to start up GUAC with TiKV and necessary compose files.

Signed-off-by: Jeff Mendoza <jlm@jlm.name>
  • Loading branch information
jeffmendoza committed Dec 12, 2023
1 parent b55c60c commit bb36eab
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/db-performance-test.yaml
Expand Up @@ -41,6 +41,7 @@ jobs:
database:
- inmem
- redis
- tikv
- arango
- ent
outputs:
Expand Down Expand Up @@ -84,6 +85,8 @@ jobs:
make start-inmem-db
elif [ ${{ matrix.database }} == redis ]; then
make start-redis-db
elif [ ${{ matrix.database }} == tikv ]; then
make start-tikv-db
elif [ ${{ matrix.database }} == "arango" ]; then
make start-arango-db
elif [ ${{ matrix.database }} == "ent" ]; then
Expand Down Expand Up @@ -166,14 +169,22 @@ jobs:
printf "%-15s%-20s%s\n" "----" "--------------" "----"
printf "%-15s%-20s%s seconds\n" "Ingestion" "inmem" "${{ env.inmem }}"
printf "%-15s%-20s%s seconds\n" "Ingestion" "arango" "${{ env.arango }}"
printf "%-15s%-20s%s seconds\n" "Ingestion" "redis" "${{ env.redis }}"
printf "%-15s%-20s%s seconds\n" "Ingestion" "tikv" "${{ env.tikv }}"
printf "%-15s%-20s%s seconds\n" "Ingestion" "ent" "${{ env.ent }}"
printf "%-15s%-20s%s seconds\n" "Query" "inmem" "${{ env.inmem_query }}"
printf "%-15s%-20s%s seconds\n" "Query" "arango" "${{ env.arango_query }}"
printf "%-15s%-20s%s seconds\n" "Query" "redis" "${{ env.redis_query }}"
printf "%-15s%-20s%s seconds\n" "Query" "tikv" "${{ env.tikv_query }}"
printf "%-15s%-20s%s seconds\n" "Query" "ent" "${{ env.ent_query }}"
env:
inmem: ${{ fromJson(needs.read.outputs.result).elapsed_time.inmem }}
arango: ${{ fromJson(needs.read.outputs.result).elapsed_time.arango }}
redis: ${{ fromJson(needs.read.outputs.result).elapsed_time.redis }}
tikv: ${{ fromJson(needs.read.outputs.result).elapsed_time.tikv }}
ent: ${{ fromJson(needs.read.outputs.result).elapsed_time.ent }}
inmem_query: ${{ fromJson(needs.read.outputs.query_result).query_time.inmem }}
arango_query: ${{ fromJson(needs.read.outputs.query_result).query_time.arango }}
redis_query: ${{ fromJson(needs.read.outputs.query_result).query_time.redis }}
tikv_query: ${{ fromJson(needs.read.outputs.query_result).query_time.tikv }}
ent_query: ${{ fromJson(needs.read.outputs.query_result).query_time.ent }}
13 changes: 13 additions & 0 deletions Makefile
Expand Up @@ -187,6 +187,19 @@ start-redis-db: check-docker-compose-tool-check
done; \
[ $$counter -eq 15 ] && { echo "Redis GUAC service did not start in time"; exit 1; } || echo "Redis GUAC service is up!"

# start graphQL server with keyvalue-tikv backend
.PHONY: start-tikv-db
start-tikv-db: check-docker-compose-tool-check
$(CONTAINER) compose -f docker-compose.yml -f container_files/tikv.yaml up -d 2>&1
@echo "Waiting for the service to start"
@counter=0; \
while [ $$counter -lt 15 ] && ! curl --silent --head --output /dev/null --fail http://localhost:8080; do \
printf '.'; \
sleep 1; \
counter=$$((counter+1)); \
done; \
[ $$counter -eq 15 ] && { echo "Tikv GUAC service did not start in time"; exit 1; } || echo "Tikv GUAC service is up!"

# start graphQL server with arango backend
.PHONY: start-arango-db
start-arango-db: check-docker-compose-tool-check
Expand Down
59 changes: 59 additions & 0 deletions container_files/tikv.yaml
@@ -0,0 +1,59 @@
version: "3.9"

volumes:
pd_guac_data:
tikv_guac_data:
services:
guac-graphql:
networks: [frontend]
image: $GUAC_IMAGE
command: "/opt/guac/guacgql"
working_dir: /guac
restart: on-failure
depends_on:
nats:
condition: service_healthy
pd:
condition: service_started
ports:
- "$GUAC_API_PORT:8080"
volumes:
- ./container_files/tikv:/guac:z
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:8080"]
interval: 10s
timeout: 10s
retries: 3
start_period: 5s
pd:
networks: [frontend]
image: docker.io/pingcap/pd:latest
ports:
- "2379"
- "2380"
volumes:
- pd_guac_data:/data
command:
- --name=pd
- --client-urls=http://0.0.0.0:2379
- --peer-urls=http://0.0.0.0:2380
- --advertise-client-urls=http://pd:2379
- --advertise-peer-urls=http://pd:2380
- --initial-cluster=pd=http://pd:2380
- --data-dir=/data
restart: on-failure
tikv:
networks: [frontend]
image: docker.io/pingcap/tikv:latest
ports:
- "20160"
volumes:
- tikv_guac_data:/data
command:
- --addr=0.0.0.0:20160
- --advertise-addr=tikv:20160
- --data-dir=/data
- --pd=pd:2379
depends_on:
- "pd"
restart: on-failure
24 changes: 24 additions & 0 deletions container_files/tikv/guac.yaml
@@ -0,0 +1,24 @@
# nats
nats-addr: nats://nats:4222

# collect-sub
csub-addr: guac-collectsub:2782
csub-listen-port: 2782

# graphql
gql-backend: keyvalue
gql-listen-port: 8080
gql-debug: true
gql-addr: http://guac-graphql:8080/query

# keyvalue
kv-store: tikv
kv-tikv: pd:2379

# collector polling
service-poll: true
use-csub: true

# certifier polling
poll: true
interval: 5m

0 comments on commit bb36eab

Please sign in to comment.