-
User ranges through
from
andto
. -
Entrypoint server traverses
from
toto
and sends each number to the destination server. -
Destination server returns an additional number by squaring each number from 1 to the number it received.
-
Entrypoint server returns all the response values after they are placed in the array
# Pseudo Code
# Request through user-side REST API
for each from in range(From, To){
# Service after REST API
for each i in range(0, from){
sumAll += i * i
}
}
Endpoint list for benchmark
-
/rest
: Request to REST API ser-
Query
from
: Should bigger than 0,required
to
: Should bigger than 0,required
-
Example
127.0.0.1:8080/rest?from=1&to=100000
-
-
/grpc/unary
: Invoke grpc-service Unary Communication-
Query
from
: Should bigger than 0,required
to
: Should bigger than 0,required
-
Example
127.0.0.1:8080/grpc/unary?from=1&to=100000
-
-
/grpc/stream/client
: Invoke grpc-service Client-Stream Communication-
Query
from
: Should bigger than 0,required
to
: Should bigger than 0,required
-
Example
127.0.0.1:8080/grpc/stream/client?from=1&to=100000
-
-
/grpc/stream/server
: Invoke grpc-service Server-Stream Communication-
Query
from
: Should bigger than 0,required
to
: Should bigger than 0,required
-
Example
127.0.0.1:8080/grpc/stream/server?from=1&to=100000
-
-
/grpc/stream/bi
: Invoke grpc-service Bi-Directional-Stream Communication-
Query
from
: Should bigger than 0,required
to
: Should bigger than 0,required
-
Example
127.0.0.1:8080/grpc/stream/bi?from=1&to=100000
-
Set up benchmark with docker-compose environment
service0
: REST API which user will send request(Benchmark entrypoint server)service1
: gRPC server, communicate withservice0
. Include Unary, Client Stream, Server Stream communication.service2
: REST API server, communicate withservice0
-
Run
docker-compose.yaml
in root directorydocker-compose up -d
-
REST API's location is
localhost:8080
. Make sure port8080
is not in used.(You can modify port indocker-compose.yaml
)
Set up benchmark with local Golang compile
- Golang with version 1.18 or upper
make
utility(For makefile)protoc
, which is compiler of protobuf
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
export PATH="$PATH:$(go env GOPATH)/bin"
-
Run
setup.sh
. It'll install golang dependencies -
Start server in following order
-
grpc-service
cd grpc-service ./bin/server
-
rest-service
cd rest-service ./bin/server
-
user-rest-handler
cd user-rest-handler ./bin/server
-
- Docker-Compose environment
- Stress test tool: Grafana Lab K6
- Visualization: Grafana
- TSDB: Influx DB
Warning: Benchmark docker environment are fully provisioned. Unexpected modifications can ruin an existing provisioned environment.
- Dashboard for each endpoint
- Influx DB Datasource connection
Currently, only the most basic stress test codes are written in this repository. If you want to change the stress test code, modify k6 scripts located in benchmark/script/script.k6.js
files.