环境
macOS Mojave 10.14.4
MacBook Pro (13-inch, 2019, Four Thunderbolt 3 ports)
CPU 2.4 GHz Intel Core i5
Memory 16 GB 2133 MHz LPDDR3
Graphics Intel Iris Plus Graphics 655 1536 MB
Nginx
➜ ~ wrk -c40 -d60 -t30 http://127.0.0.1
Running 1m test @ http://127.0.0.1
30 threads and 40 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.66ms 0.94ms 26.25ms 96.41%
Req/Sec 381.73 29.18 606.00 83.51%
684871 requests in 1.00m, 1.08GB read
Requests/sec: 11399.62
Transfer/sec: 18.39MB
Zuul+Nginx
➜ ~ wrk -c40 -d60 -t30 http://127.0.0.1:8080
Running 1m test @ http://127.0.0.1:8080
30 threads and 40 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 5.43ms 1.81ms 39.41ms 80.45%
Req/Sec 185.58 34.76 290.00 67.98%
333175 requests in 1.00m, 522.44MB read
Requests/sec: 5543.40
Transfer/sec: 8.69MB
用Zuul反向代理Nginx减少了大概一半的请求数,可见Zuul性能比Nginx更差,比Nginx性能差50%以下