Giter VIP home page Giter VIP logo

rpc-benchmark's Introduction

Benchmark

测试环境

  • CPU: 2.5 GHz Intel Core i7
  • Memory: 16 GB 2133 MHz LPDDR3
  • OS: MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
  • Go: 1.11

测试代码client是通过protobuf编解码和server通讯的。 请求发送给server, server解码、更新两个字段、编码再发送给client,所以整个测试会包含客户端的编解码和服务器端的编解码。 消息的内容大约为581 byte, 在传输的过程中会增加少许的头信息,所以完整的消息大小在600字节左右。

测试用的proto文件如下:

syntax = "proto2";

package main;

option optimize_for = SPEED;


message BenchmarkMessage {
  required string field1 = 1;
  optional string field9 = 9;
  optional string field18 = 18;
  optional bool field80 = 80 [default=false];
  optional bool field81 = 81 [default=true];
  required int32 field2 = 2;
  required int32 field3 = 3;
  optional int32 field280 = 280;
  optional int32 field6 = 6 [default=0];
  optional int64 field22 = 22;
  optional string field4 = 4;
  repeated fixed64 field5 = 5;
  optional bool field59 = 59 [default=false];
  optional string field7 = 7;
  optional int32 field16 = 16;
  optional int32 field130 = 130 [default=0];
  optional bool field12 = 12 [default=true];
  optional bool field17 = 17 [default=true];
  optional bool field13 = 13 [default=true];
  optional bool field14 = 14 [default=true];
  optional int32 field104 = 104 [default=0];
  optional int32 field100 = 100 [default=0];
  optional int32 field101 = 101 [default=0];
  optional string field102 = 102;
  optional string field103 = 103;
  optional int32 field29 = 29 [default=0];
  optional bool field30 = 30 [default=false];
  optional int32 field60 = 60 [default=-1];
  optional int32 field271 = 271 [default=-1];
  optional int32 field272 = 272 [default=-1];
  optional int32 field150 = 150;
  optional int32 field23 = 23 [default=0];
  optional bool field24 = 24 [default=false];
  optional int32 field25 = 25 [default=0];
  optional bool field78 = 78;
  optional int32 field67 = 67 [default=0];
  optional int32 field68 = 68;
  optional int32 field128 = 128 [default=0];
  optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"];
  optional int32 field131 = 131 [default=0];
}

测试的并发client是 100, 500 and 1000。总请求数一百万。

测试结果

teleport

teleport 是一个通用、高效、灵活的Socket框架。可用于Peer-Peer对等通信、RPC、长连接网关、微服务、推送服务,游戏服务等领域。

一个服务器和一个客户端,在同一台机器上

并发client 平均值(ms) 中位数(ms) 最大值(ms) 最小值(ms) p99 吞吐率(TPS)
100 1 1 30 0 8 50002
500 11 10 67 0 29 44942
1000 23 22 145 0 57 42867

gRPC

gRPC 是Google开发的一个RPC框架,支持多种编程语言。

一个服务器和一个客户端,在同一台机器上

并发client 平均值(ms) 中位数(ms) 最大值(ms) 最小值(ms) p99 吞吐率(TPS)
100 3 2 55 0 14 33089
500 15 14 154 0 77 32069
1000 34 31 233 0 104 28769

rpcx

rpcx 是一款国人开发的类似阿里巴巴Dubbo 和微博Motan 的分布式的RPC服务框架,基于Golang net/rpc实现。

一个服务器和一个客户端,在同一台机器上

并发client 平均值(ms) 中位数(ms) 最大值(ms) 最小值(ms) p99 吞吐率(TPS)
100 2 1 85 0 13 45442
500 11 10 108 0 63 42025
1000 26 23 263 0 144 36837

图表对比

EnvironmentThroughputsMean LatencyP99 Latency

rpc-benchmark's People

Contributors

andeya avatar yangwenmai avatar

Watchers

 avatar

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.