Skip to content

Latest commit

 

History

History
115 lines (84 loc) · 2.36 KB

README.md

File metadata and controls

115 lines (84 loc) · 2.36 KB

Ping service gRPC with Golang

Overview

Using the gRPC framework to build a simple ping-service that supports ping pong API. Then using the locust and boomer to benchmark ping-service. In addition the ping-service is implemented in golang language.

Architecture

Requirment

  • Golang.
  • Locust.

Installation

Build

#clone project
$ git clone https://github.com/phamtai97/ping-service.git

Run

  • Run locust
# go to directory locust 
$ cd ./locust
$ chmod +x run_locust.sh

# run locust
./run_locust.sh
  • Run service
# go to directory ./cmd/server
$ cd ./cmd/server

# build service
$ go build

# run service
$ ./server
INFO[0000] Start Ping service port 10002 ... 
  • Run benchmark
# go to directory ./benchmark/run
$ cd ./benchmark/run

# build
$ go build

# run benchmark
$ ./run
2019/07/26 14:55:32 Boomer is built with gomq support.
2019/07/26 14:55:46 Boomer is connected to master(tcp://127.0.0.1:5557) press Ctrl+c to quit.

Infomation benchmark

Hardware configuration

  • MacBook Pro v10.14.5
  • CPU: 2.3 GHz Intel Core i5
  • RAM: 16 GB 2133 MHz LPDDR3

Scenario

  • Use 1000 users to call ping API at the same time.

Result

  • Dashboard
  • Overview chart
  • p99
  • Monitor the Processes

Evaluation

  • Ping servic average loaded 20000 req/s.
  • Average processing of 1 request takes 48ms.
  • p99 is 110ms.
  • CPU is used at full capacity.

Contribution

If you find anything wrong or would like to contribute in any way, feel free to create a pull request/open an issue/send me a message. Any comments are welcome!

Acknowledgments