HttpServer性能比较

在自己的本子上随便测了下几款HttpServer,环境信息就不贴出来了,主要是比对下差距。

测试内容是输出 text/plain 的 hello, world。

先说结论:Netty > JDK HttpServer > Jersey-Netty > Jersey-HttpServer > SpringBoot。

但需要注意下,第一名的Netty吞吐是第二名的HttpServer的2.7倍,而且errors表现也很优秀。

Jersey 的 overhead 也摆在那儿,吞吐瞬间掉到 13156.38 req/sec,可见同步模型的确不擅长撑并发。

排名最后的是 SpringBoot,此前知道它性能差,没想到差成这样。

## Netty
[[email protected]] Desktop$ wrk -t8 -c1000 -d30s http://127.0.0.1:8080/rest/hello
Running 30s test @ http://127.0.0.1:8080/rest/hello
  8 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    23.03ms   28.61ms 292.67ms   86.37%
    Req/Sec     7.32k     2.27k   21.72k    76.67%
  1743807 requests in 30.10s, 169.63MB read
  Socket errors: connect 0, read 871, write 0, timeout 0
Requests/sec:  57938.49
Transfer/sec:      5.64MB

## JDK HttpServer
[[email protected]] Desktop$ wrk -t8 -c1000 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
  8 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    17.15ms   25.00ms 570.39ms   98.39%
    Req/Sec     2.69k     1.05k    9.14k    72.41%
  631779 requests in 30.10s, 53.02MB read
  Socket errors: connect 0, read 5491, write 41, timeout 0
Requests/sec:  20990.68
Transfer/sec:      1.76MB

## Jersey-Netty
[[email protected]] Desktop$ wrk -t8 -c1000 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
  8 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    97.69ms  103.37ms 867.56ms   82.64%
    Req/Sec     1.69k     0.93k   10.89k    84.29%
  396003 requests in 30.10s, 37.77MB read
  Socket errors: connect 0, read 482, write 83, timeout 0
Requests/sec:  13156.38
Transfer/sec:      1.25MB

## Jersey-HttpServer
[[email protected]] Desktop$ wrk -t8 -c1000 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
  8 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    19.38ms   40.94ms   1.52s    95.95%
    Req/Sec     1.62k     1.35k   11.31k    79.09%
  353962 requests in 30.10s, 38.14MB read
  Socket errors: connect 0, read 17293, write 229, timeout 0
Requests/sec:  11759.31
Transfer/sec:      1.27MB

## SpringBoot-tomcat
[[email protected]] Desktop$ wrk -t8 -c1000 -d30s http://127.0.0.1:8080/hello
Running 30s test @ http://127.0.0.1:8080/hello
  8 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   185.73ms  176.82ms   1.76s    66.01%
    Req/Sec   773.16    496.27     3.62k    76.40%
  188085 requests in 30.08s, 22.62MB read
  Socket errors: connect 0, read 498, write 3, timeout 0
Requests/sec:   6252.72
Transfer/sec:    770.17KB

原文地址:https://www.cnblogs.com/mougg/p/11029310.html

时间: 2024-08-08 16:15:29

HttpServer性能比较的相关文章

HttpServer带阻塞性能比较

# Netty [[email protected]] http-server-compare$ wrk -t8 -c1000 -d60s http://127.0.0.1:8080/Running 1m test @ http://127.0.0.1:8080/  8 threads and 1000 connections  Thread Stats   Avg      Stdev     Max   +/- Stdev    Latency     1.20s     1.61ms  

Atitit.h5 web webview性能提升解决方案-----fileStrore缓存离线存储+http方案

1. 业务场景 android+webview h5 css背景图性能提升1 2. 根据标准,到目前为止,H5 一共有6种缓存机制,有些是之前已有,有些是 H5 才新加入的.1 2.1. 各种方案的比较,如下图2 3. Attilax的解决之道 file 缓存+http3 3.1. 图片的下载3 3.2. Jsbridge 4android5 3.3. http协议6 4. 参考8 1. 业务场景 android+webview h5 css背景图性能提升 图片的缓存大概儿需要500m的规模..

apache性能调优(转)

一.总结前一天的学习 在前两天的学习中我们知道.了解并掌握了Web Server结合App Server实现单向Https的这样的一个架构.这个架构是一个非常基础的J2ee工程上线布署时的一种架构.在前两天的教程中,还讲述了Http服务器.App Server的最基本安全配置(包括单向https的实现), 它只是避免了用户可以通过浏览器侵入我们的Web访问器或者能够通过Web浏览器来查询我们的Web目录结构及其目录内的文件与相关内容,这种入侵我们把它称为: Directory traversal

WEBserver、应用程序server、HTTPserver差别

WEBserver.应用程序server.HTTPserver差别 WEBserver.应用程序server.HTTPserver有何差别?IIS.Apache.Tomcat.Weblogic.WebSphere都各属于哪种server,这些问题困惑了非常久,今天最终梳理清楚了: -Webserver的基本功能就是提供Web信息浏览服务.它仅仅需支持HTTP协议.HTML文档格式及URL. 与client的网络浏览器配合.由于Webserver主要支持的协议就是HTTP,所以通常情况下HTTPs

为golang程序使用pprof远程查看httpserver运行堆栈,cpu耗时等信息

pprof是个神马玩意儿? pprof - manual page for pprof (part of gperftools) 是gperftools工具的一部分 gperftools又是啥? These tools are for use by developers so that they can create more robust applications. Especially of use to those developing multi-threaded application

通向架构师的道路(第三天)之apache性能调优

通向架构师的道路(第三天)之apache性能调优 分类: 架构师之路   2012-07-01 23:30 1434人阅读 评论(2) 收藏 举报 一.总结前一天的学习 在前两天的学习中我们知道.了解并掌握了Web Server结合App Server实现单向Https的这样的一个架构.这个架构是一个非常基础的J2ee工程上线布署时的一种架构.在前两天的教程中,还讲述了Http服务器.App Server的最基本安全配置(包括单向https的实现), 它只是避免了用户可以通过浏览器侵入我们的We

10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包

- 10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包 - 扩展tcp三次握手四次挥手 http://www.doc88.com/p-9913773324388.html  - tshark几个用法:http://www.aminglinux.com/bbs/thread-995-1-1.html  # 10.6 监控io性能 ![mark](http://oqxf7c508.bkt.clouddn.com/b

iOS开发——项目实战总结&UITableView性能优化与卡顿问题

UITableView性能优化与卡顿问题 1.最常用的就是cell的重用, 注册重用标识符 如果不重用cell时,每当一个cell显示到屏幕上时,就会重新创建一个新的cell 如果有很多数据的时候,就会堆积很多cell.如果重用cell,为cell创建一个ID 每当需要显示cell 的时候,都会先去缓冲池中寻找可循环利用的cell,如果没有再重新创建cell 2.避免cell的重新布局 cell的布局填充等操作 比较耗时,一般创建时就布局好 如可以将cell单独放到一个自定义类,初始化时就布局好

Java性能优化之JVM GC(垃圾回收机制)

Java的性能优化,整理出一篇文章,供以后温故知新. JVM GC(垃圾回收机制) 在学习Java GC 之前,我们需要记住一个单词:stop-the-world .它会在任何一种GC算法中发生.stop-the-world 意味着JVM因为需要执行GC而停止了应用程序的执行.当stop-the-world 发生时,除GC所需的线程外,所有的线程都进入等待状态,直到GC任务完成.GC优化很多时候就是减少stop-the-world 的发生. JVM GC回收哪个区域内的垃圾? 需要注意的是,JV