HttpServer带阻塞性能比较

Posted mougg

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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   1.20s    62.50%
    Req/Sec     2.44      3.38    20.00     91.94%
  472 requests in 1.00m, 47.02KB read
  Socket errors: connect 755, read 81, write 29, timeout 464
Requests/sec:      7.86
Transfer/sec:     801.79B

 

# Jooby

[[email protected]] http-server-performance$ 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.02s     3.13ms   1.02s    68.75%
    Req/Sec    12.27     24.98   190.00     95.93%
  1888 requests in 1.00m, 210.19KB read
  Socket errors: connect 755, read 35, write 0, timeout 1856
Requests/sec:     31.46
Transfer/sec:      3.50KB

 

# Jdk

[[email protected]] http-server-performance$ 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     5.24ms    9.52ms 273.62ms   99.27%
    Req/Sec     0.98k     1.61k    6.55k    82.65%
  32882 requests in 1.00m, 3.79MB read
  Socket errors: connect 755, read 33747, write 189, timeout 0
  Non-2xx or 3xx responses: 32882
Requests/sec:    547.44
Transfer/sec:     64.69KB

 

# Jersey-jdk

[[email protected]] http-server-performance$ 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     5.47ms    3.14ms  62.59ms   89.71%
    Req/Sec     0.94k     1.17k    5.15k    81.63%
  33102 requests in 1.00m, 3.82MB read
  Socket errors: connect 755, read 33729, write 81, timeout 0
  Non-2xx or 3xx responses: 33102
Requests/sec:    550.74
Transfer/sec:     65.08K

 

# Jersey-netty

[[email protected]] http-server-performance$ 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.01s    49.59ms   1.48s    97.78%
    Req/Sec   114.74    158.71   828.00     82.89%
  14455 requests in 0.94m, 1.39MB read
  Socket errors: connect 755, read 160, write 23, timeout 245
Requests/sec:    255.29
Transfer/sec:     25.18KB

 

# RESTeasy-netty

[[email protected]] http-server-performance$ 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.29s     2.36ms   1.29s    62.50%
    Req/Sec     5.39      9.30    66.00     91.87%
  944 requests in 1.00m, 121.69KB read
  Socket errors: connect 755, read 228, write 64, timeout 928
Requests/sec:     15.71
Transfer/sec:      2.03KB

 

# SpringBoot

[[email protected]] http-server-performance$ 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.22s   270.02ms   1.98s    78.50%
    Req/Sec    71.83     89.66   430.00     84.32%
  11720 requests in 1.00m, 1.41MB read
  Socket errors: connect 755, read 205, write 35, timeout 0
Requests/sec:    195.10
Transfer/sec:     24.01KB

 

以上是关于HttpServer带阻塞性能比较的主要内容,如果未能解决你的问题,请参考以下文章

今日小结

线程阻塞导致的性能问题分析

nginx源码包安装

tornado httpserver

Spring Boot 内嵌容器Undertow取代tomcat

性能优化之无阻塞加载脚步方法比较