Giter VIP home page Giter VIP logo

Comments (2)

Tradias avatar Tradias commented on June 2, 2024

I have added a client-streaming benchmark to https://github.com/Tradias/grpc_bench. Currently only for cpp_asio_grpc_callback_bench and cpp_asio_grpc_coroutine_bench. You run it using

./build.sh cpp_asio_grpc_callback_bench cpp_asio_grpc_coroutine_bench

export GRPC_USE_CLIENT_STREAMING=true
export GRPC_REQUEST_SCENARIO=string_100B
# further env vars like GRPC_SERVER_CPUS and GRPC_CLIENT_CPUS
./bench.sh cpp_asio_grpc_callback_bench cpp_asio_grpc_coroutine_bench

When running the benchmarks make sure that:

  • GRPC_CLIENT_CPUS is set high enough. In the result, avg. cpu must be equal to 100% * GRPC_SERVER_CPUS.
  • Your CPU is not running at 100% during the benchmark.

On my machine I only see a minor difference between streaming and unary:

name req/s avg. latency 90 % in 95 % in 99 % in avg. cpu avg. memory
cpp_asio_grpc_callback 27007 36.86 ms 39.64 ms 40.34 ms 41.94 ms 102.74% 6.45 MiB
cpp_asio_grpc_coroutine 25190 39.54 ms 42.16 ms 42.83 ms 44.98 ms 102.09% 6.42 MiB

Benchmark Execution Parameters:

  • GRPC_BENCHMARK_DURATION=20s
  • GRPC_BENCHMARK_WARMUP=5s
  • GRPC_SERVER_CPUS=1
  • GRPC_SERVER_RAM=512m
  • GRPC_CLIENT_CONNECTIONS=50
  • GRPC_CLIENT_CONCURRENCY=1000
  • GRPC_CLIENT_QPS=0
  • GRPC_CLIENT_CPUS=10
  • GRPC_REQUEST_SCENARIO=string_100B
  • GRPC_USE_CLIENT_STREAMING=false

name req/s avg. latency 90 % in 95 % in 99 % in avg. cpu avg. memory
cpp_asio_grpc_callback 25427 39.16 ms 41.62 ms 42.42 ms 45.01 ms 102.45% 6.94 MiB
cpp_asio_grpc_coroutine 21566 46.17 ms 49.24 ms 50.01 ms 51.90 ms 103.17% 6.7 MiB

Benchmark Execution Parameters:

  • GRPC_BENCHMARK_DURATION=20s
  • GRPC_BENCHMARK_WARMUP=5s
  • GRPC_SERVER_CPUS=1
  • GRPC_SERVER_RAM=512m
  • GRPC_CLIENT_CONNECTIONS=50
  • GRPC_CLIENT_CONCURRENCY=1000
  • GRPC_CLIENT_QPS=0
  • GRPC_CLIENT_CPUS=10
  • GRPC_REQUEST_SCENARIO=string_100B
  • GRPC_USE_CLIENT_STREAMING=true

from asio-grpc.

rogerwrld avatar rogerwrld commented on June 2, 2024

Resolved

from asio-grpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.