Skip to content

Building ping service with the gRPC framework and use the golang language. Also using the boomer client and locust to benchmark.

Notifications You must be signed in to change notification settings

phamtai97/ping-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Building ping service with the gRPC framework and use the golang language. Also using the boomer client and locust to benchmark.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published