openrestyweb
route:get("/say_hello", function(self) ngx.say('hello') end)
測試,注意關閉 #lua_code_cache off;
spring
$ ./wrk -t12 -c100 -d30s http://localhost:6699/say_hello Running 30s test @ http://localhost:6699/say_hello 12 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 8.91ms 26.32ms 361.12ms 93.81% Req/Sec 3.48k 1.49k 19.27k 81.68% 1228717 requests in 30.10s, 250.71MB read Requests/sec: 40823.76 Transfer/sec: 8.33MB
spring bootapp
@RequestMapping(value = "/say_hello") public String sayHello(){ return "hello"; }
測試測試
$ ./wrk -t12 -c100 -d30s http://localhost:9000/web/say_hello Running 30s test @ http://localhost:9000/web/say_hello 12 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 22.53ms 48.40ms 636.73ms 90.86% Req/Sec 1.06k 424.26 4.11k 69.68% 377705 requests in 30.08s, 53.02MB read Requests/sec: 12558.31 Transfer/sec: 1.76MB
大概是 spring boot 的4倍lua