跑4-10次,取最優。java
concurrency能夠從1,4,16,64,128依次遞增web
請求次數這裏10w-20w左右,若是是用ab,則-n 100000,若是是wrk,則-d10s左右spring
類型:plaintext,輸出hellojson
跑滿cpuapi
這裏只跑servlet容器,配置爲默認配置(好比tomcat的acceptCount默認100,maxThreads默認200)tomcat
mac air(2核物理cpu,4核邏輯cpu,8G內存,java8
)springboot
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.RELEASEui
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
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
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