spring-boot-starter-netty, Spring Boot的联网容器

分享于 

5分钟阅读

GitHub

  繁體 雙語
Netty Container for Spring Boot
  • 源代码名称:spring-boot-starter-netty
  • 源代码网址:http://www.github.com/DanielThomas/spring-boot-starter-netty
  • spring-boot-starter-netty源代码文档
  • spring-boot-starter-netty源代码下载
  • Git URL:
    git://www.github.com/DanielThomas/spring-boot-starter-netty.git
    Git Clone代码到本地:
    git clone http://www.github.com/DanielThomas/spring-boot-starter-netty
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/DanielThomas/spring-boot-starter-netty
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    

    一个面向 spring Boot的嵌入式嵌入式 servlet。

    包括基本过滤器和servlet支持。 我对 Spring Boot 是相当新的,但这种方法似乎适合于servlet容器的自适应视图。 还没有完成异步servlet支持。

    Build Status

    性能

    使用 runTestApp Gradle任务启动与这里使用的配置相同的服务器。 测试以 wrk 运行,参数如下:

    
    wrk -H 'Host: localhost' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Connection: keep-alive' -d 120 -c 32 -t 2 http://localhost:8080/plaintext
    
    
    
    

    7.0.55

    
    Running 2m test @ http://localhost:8080/plaintext
    
    
     2 threads and 32 connections
    
    
     Thread Stats Avg Stdev Max +/- Stdev
    
    
     Latency 22.96ms 115.34ms 628.47ms 96.50%
    
    
     Req/Sec 16.33k 4.74k 34.44k 83.57%
    
    
     3691775 requests in 2.00m, 497.09MB read
    
    
    Requests/sec: 30764.62
    
    
    Transfer/sec: 4.14MB
    
    
    
    

    8.0.9

    
    Running 2m test @ http://localhost:8080/plaintext
    
    
     2 threads and 32 connections
    
    
     Thread Stats Avg Stdev Max +/- Stdev
    
    
     Latency 114.10ms 745.91ms 5.04s 97.75%
    
    
     Req/Sec 15.67k 2.99k 27.56k 91.68%
    
    
     3553322 requests in 2.00m, 478.45MB read
    
    
     Socket errors: connect 0, read 0, write 0, timeout 3
    
    
    Requests/sec: 29611.00
    
    
    Transfer/sec: 3.99MB
    
    
    
    

    Prototype联网 4.0桥

    
    Running 2m test @ http://localhost:8080/plaintext
    
    
     2 threads and 32 connections
    
    
     Thread Stats Avg Stdev Max +/- Stdev
    
    
     Latency 1.14ms 6.64ms 128.33ms 99.33%
    
    
     Req/Sec 19.64k 4.16k 45.22k 83.96%
    
    
     4459068 requests in 2.00m, 331.69MB read
    
    
    Requests/sec: 37158.91
    
    
    Transfer/sec: 2.76MB
    
    
    
    

    注意:传输/秒的差异是由Tomcat返回的服务器和日期头造成

    Prototype联网 4.1测试版 1桥

    
    Running 2m test @ http://localhost:8080/plaintext
    
    
     2 threads and 32 connections
    
    
     Thread Stats Avg Stdev Max +/- Stdev
    
    
     Latency 1.09ms 7.58ms 200.99ms 99.80%
    
    
     Req/Sec 19.14k 2.19k 39.89k 84.44%
    
    
     4366902 requests in 2.00m, 408.12MB read
    
    
    Requests/sec: 36390.84
    
    
    Transfer/sec: 3.40MB
    
    
    
    

    与空servlet相比:

    
    Running 2m test @ http://localhost:8080/null
    
    
     2 threads and 32 connections
    
    
     Thread Stats Avg Stdev Max +/- Stdev
    
    
     Latency 820.84us 3.47ms 66.04ms 99.70%
    
    
     Req/Sec 26.03k 4.27k 45.44k 69.68%
    
    
     5894335 requests in 2.00m, 505.91MB read
    
    
    Requests/sec: 49119.58
    
    
    
    

    并直接从联网服务器服务响应:

    
    Running 2m test @ http://localhost:8080/nullnetty
    
    
     2 threads and 32 connections
    
    
     Thread Stats Avg Stdev Max +/- Stdev
    
    
     Latency 2.01ms 23.54ms 400.01ms 99.65%
    
    
     Req/Sec 27.21k 4.26k 41.44k 66.08%
    
    
     6164886 requests in 2.00m, 223.41MB read
    
    
    Requests/sec: 51374.16
    
    
    
    

    Prototype联网 4.1测试版 3桥( 提交 eb531c6 )

    
    Running 2m test @ http://localhost:8080/plaintext
    
    
     2 threads and 32 connections
    
    
     Thread Stats Avg Stdev Max +/- Stdev
    
    
     Latency 1.95ms 18.62ms 289.53ms 99.57%
    
    
     Req/Sec 20.48k 2.55k 37.78k 86.51%
    
    
     4637061 requests in 2.00m, 698.71MB read
    
    
    Requests/sec: 38642.24
    
    
    Transfer/sec: 5.82MB
    
    
    
    

    相关文章