本文转载自 RPC Benchmark 作者 鲁小憨 的简书博文
https://www.jianshu.com/p/caf51f5cfbaa
测试说明
- 仅限于 Java
- 客户端使用 JMH 进行压测, 32 线程, 3 轮预热 3 轮测试, 每轮 10s
- 每次运行前都会执行 killall java, 但没有在每轮测试时重启操作系统
- 所有类库版本在发布时都是最新的, 除非存在 bug
- 所有框架都尽量参考该项目自带的 Benchmark 实现
- 将会一直持续, 不定期发布测试结果
测试用例
- boolean existUser(String email), 判断某个 email 是否存在
- boolean createUser(User user), 添加一个 User
- User getUser(long id), 根据 id 获取一个用户
- Page<User> listUser(int pageNo), 获取用户列表
运行结果
生成时间: 2018-05-12 21:15:11
硬件环境: 阿里云 ecs.hfc5.xlarge Intel Xeon Gold 6149, 4CPU 8GB RAM 两台
软件环境: Ubuntu x64 16.04.5, Java HotSpot(TM) 64-Bit Server VM 10+46
启动参数: java -server -Xmx1g -Xms1g -XX:MaxDirectMemorySize=1g -XX:+UseG1GC
existUser
framework | thrpt (ops/ms) | avgt (ms) | p90 (ms) | p99 (ms) | p999 (ms) |
---|---|---|---|---|---|
turbo-rpc | 152.012 | 0.21 | 0.318 | 0.447 | 0.669 |
servicecomb | 129.413 | 0.246 | 0.294 | 0.358 | 1.279 |
jupiter | 128.015 | 0.249 | 0.36 | 0.543 | 3.826 |
thrift | 117.827 | 0.273 | 0.52 | 0.97 | 1.454 |
netty | 102.939 | 0.304 | 0.335 | 0.386 | 0.815 |
turbo-rest | 95.774 | 0.341 | 0.845 | 1.505 | 4.047 |
undertow | 92.956 | 0.342 | 0.88 | 1.552 | 3.532 |
undertow-async | 82.539 | 0.38 | 0.773 | 1.604 | 5.153 |
armeria-http | 75.795 | 0.411 | 0.731 | 1.305 | 6.054 |
dubbo | 74.731 | 0.43 | 0.532 | 0.7 | 3.361 |
dubbo-kryo | 74.728 | 0.43 | 0.532 | 0.713 | 3.758 |
motan | 61.324 | 0.516 | 0.813 | 2.013 | 11.862 |
rapidoid | 58.35 | 0.554 | 1.634 | 3.26 | 10.568 |
hprose | 45.945 | 0.735 | 0.414 | 2.39 | 40.239 |
springboot-undertow | 34.374 | 0.938 | 1.135 | 8.764 | 21.561 |
springwebflux | 32.075 | 1.008 | 1.571 | 1.995 | 8.249 |
grpc | 31.134 | 1.065 | 1.294 | 1.509 | 6.971 |
springboot | 26.885 | 1.185 | 1.599 | 9.945 | 23.298 |
createUser
framework | thrpt (ops/ms) | avgt (ms) | p90 (ms) | p99 (ms) | p999 (ms) |
---|---|---|---|---|---|
servicecomb | 124.015 | 0.255 | 0.306 | 0.382 | 1.436 |
jupiter | 114.996 | 0.275 | 0.412 | 0.633 | 4.002 |
turbo-rpc | 114.837 | 0.282 | 0.376 | 0.543 | 0.823 |
thrift | 110.952 | 0.294 | 0.563 | 1.041 | 1.606 |
undertow | 93.593 | 0.346 | 0.823 | 1.479 | 3.903 |
turbo-rest | 88.512 | 0.353 | 0.894 | 1.618 | 5.087 |
netty | 85.774 | 0.388 | 0.428 | 0.511 | 0.791 |
undertow-async | 79.475 | 0.409 | 0.8 | 1.528 | 5.235 |
armeria-http | 65.109 | 0.498 | 0.688 | 1.98 | 7.922 |
motan | 56.708 | 0.561 | 0.893 | 1.892 | 11.289 |
dubbo-kryo | 54.754 | 0.583 | 0.732 | 0.938 | 5.169 |
hprose | 37.22 | 0.933 | 0.484 | 38.601 | 43.451 |
dubbo | 31.811 | 0.988 | 1.284 | 1.642 | 7.471 |
springwebflux | 30.212 | 1.084 | 1.694 | 2.13 | 6.824 |
grpc | 29.992 | 1.029 | 1.321 | 1.544 | 4.5 |
springboot-undertow | 28.142 | 1.139 | 2.003 | 6.398 | 13.976 |
springboot | 26.411 | 1.196 | 1.647 | 10.994 | 26.771 |
rapidoid | 22.434 | 1.438 | 0.913 | 26.345 | 46.137 |
getUser
framework | thrpt (ops/ms) | avgt (ms) | p90 (ms) | p99 (ms) | p999 (ms) |
---|---|---|---|---|---|
turbo-rpc | 133.121 | 0.241 | 0.364 | 0.516 | 0.743 |
servicecomb | 122.801 | 0.262 | 0.313 | 0.391 | 2.651 |
jupiter | 111.682 | 0.29 | 0.45 | 0.689 | 4.301 |
thrift | 110.368 | 0.289 | 0.553 | 1.02 | 1.573 |
undertow | 87.382 | 0.343 | 0.981 | 1.765 | 3.945 |
turbo-rest | 81.373 | 0.392 | 0.696 | 1.397 | 4.383 |
undertow-async | 81.162 | 0.405 | 0.773 | 1.534 | 3.777 |
netty | 73.999 | 0.421 | 0.442 | 0.472 | 0.886 |
armeria-http | 70.776 | 0.448 | 0.753 | 1.389 | 4.366 |
motan | 60.062 | 0.542 | 0.87 | 1.964 | 11.813 |
dubbo-kryo | 55.375 | 0.564 | 0.722 | 0.951 | 5.317 |
rapidoid | 51.64 | 0.625 | 2.019 | 4.076 | 11.72 |
hprose | 48.659 | 0.649 | 0.701 | 1.356 | 40.042 |
dubbo | 32.924 | 0.974 | 1.245 | 1.692 | 7.406 |
grpc | 30.941 | 1.042 | 1.233 | 1.462 | 3.453 |
springboot-undertow | 30.694 | 1.063 | 1.27 | 9.241 | 21.463 |
springwebflux | 26.173 | 1.232 | 1.915 | 2.359 | 6.955 |
springboot | 24.969 | 1.297 | 1.743 | 10.879 | 27.329 |
listUser
framework | thrpt (ops/ms) | avgt (ms) | p90 (ms) | p99 (ms) | p999 (ms) |
---|---|---|---|---|---|
jupiter | 46.89 | 0.684 | 1.057 | 1.8 | 9.273 |
turbo-rpc | 45.852 | 0.713 | 1.745 | 2.126 | 7.274 |
servicecomb | 45.218 | 0.707 | 0.977 | 1.718 | 6.94 |
thrift | 34.813 | 0.91 | 1.78 | 3.727 | 9.208 |
grpc | 34.112 | 0.916 | 1.2 | 1.491 | 6.151 |
motan | 32.584 | 0.982 | 1.632 | 2.998 | 10.928 |
undertow | 32.094 | 1.01 | 1.352 | 2.171 | 9.29 |
undertow-async | 32.094 | 0.994 | 1.298 | 2.494 | 10.943 |
armeria-http | 31.701 | 1.018 | 1.579 | 2.9 | 9.945 |
netty | 26.653 | 1.18 | 1.335 | 1.743 | 4.538 |
rapidoid | 23.563 | 1.368 | 1.128 | 20.873 | 38.076 |
turbo-rest | 21.274 | 1.516 | 1.823 | 3.166 | 9.929 |
dubbo-kryo | 20.664 | 1.553 | 2.087 | 2.982 | 8.716 |
hprose | 20.017 | 1.602 | 1.597 | 2.044 | 50.397 |
springwebflux | 19.617 | 1.631 | 2.56 | 3.084 | 9.077 |
springboot-undertow | 18.478 | 1.745 | 2.908 | 11.944 | 21.758 |
springboot | 16.825 | 1.909 | 2.585 | 13.23 | 34.275 |
dubbo | 4.683 | 6.922 | 9.224 | 12.534 | 19.741 |
更新说明
- 硬件变化, 升级为 ecs.hfc5.xlarge Intel Xeon Gold 6149
- 添加 3 个新的测评项目:armeria servicecomb springboot-undertow
- 其他: 常规版本升级, 都升级到了最新版本 (dubbo 2.6.1 存在 bug,继续使用 2.6.0)
致谢
特别感谢下列人员对本项目的大力支持
- turbo: hank-whu
- jupiter: fengjiachun
- hprose: andot
- servicecomb: imlidian
免责声明
- 能力所限错误在所难免, 本测试用例及测试结果仅供参考
- 如果你认为 xxx 框架的代码或配置存在问题,那么欢迎发起 Pull Request
- 利益相关: 本测试用例作者同时为 turbo undertow-async 的作者
快速链接
往期评测:
RPC Benchmark Round 2
RPC Benchmark Round 1
测试说明:
rpc-benchmark 测试说明
rpc-benchmark 项目代码