跑分

跑4-10次,取最优。

  • concurrency可以从1,4,16,64,128依次递增

  • 请求次数这里10w-20w左右,如果是用ab,则-n 100000,如果是wrk,则-d10s左右

  • 类型:plaintext,输出hello

  • 跑满cpu

  • 这里只跑servlet容器,配置为默认配置(比如tomcat的acceptCount默认100,maxThreads默认200)

配置

mac air(2核物理cpu,4核逻辑cpu,8G内存,java8)

  • cpu

sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i7-5650U CPU @ 2.20GHz
sysctl -n hw.physicalcpu
2
sysctl -n hw.logicalcpu
4
  • jdk

java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
  • springboot
    1.4.3.RELEASE

tomcat

wrk -t4 -c128 -d10s --latency http://localhost:8080/bench/hello
Running 10s test @ http://localhost:8080/bench/hello
  4 threads and 128 connections

  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     8.42ms    9.66ms 142.35ms   91.16%
    Req/Sec     3.66k     1.49k   11.13k    72.97%
  Latency Distribution
     50%    5.75ms
     75%   10.45ms
     90%   17.03ms
     99%   52.03ms
  144723 requests in 10.06s, 22.11MB read
  Socket errors: connect 0, read 5, write 0, timeout 0
Requests/sec:  14384.60
Transfer/sec:      2.20MB

wrk -t4 -c128 -d10s --latency http://localhost:8080/bench/hello
Running 10s test @ http://localhost:8080/bench/hello
  4 threads and 128 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.93ms    9.99ms 133.05ms   93.28%
    Req/Sec     3.84k     1.32k    9.39k    76.17%
  Latency Distribution
     50%    5.71ms
     75%    9.52ms
     90%   14.95ms
     99%   54.62ms
  152596 requests in 10.10s, 23.31MB read
Requests/sec:  15109.07
Transfer/sec:      2.31MB

undertow

wrk -t4 -c128 -d10s --latency http://localhost:8080/bench/hello
Running 10s test @ http://localhost:8080/bench/hello
  4 threads and 128 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     8.75ms   13.83ms 222.22ms   96.01%
    Req/Sec     4.70k   595.93     7.91k    76.50%
  Latency Distribution
     50%    6.33ms
     75%    7.38ms
     90%   10.56ms
     99%   81.18ms
  188209 requests in 10.07s, 33.39MB read
Requests/sec:  18696.15
Transfer/sec:      3.32MB

jetty

wrk -t4 -c128 -d10s --latency http://localhost:8080/bench/hello
Running 10s test @ http://localhost:8080/bench/hello
  4 threads and 128 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     6.77ms    6.83ms 235.64ms   91.77%
    Req/Sec     4.53k     1.09k   10.90k    76.59%
  Latency Distribution
     50%    6.22ms
     75%    8.08ms
     90%   12.61ms
     99%   28.70ms
  180732 requests in 10.09s, 27.92MB read
  Socket errors: connect 0, read 57, write 0, timeout 0
Requests/sec:  17918.38
Transfer/sec:      2.77MB

doc


codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...