Skip to main content
Version: 2.7.0.3

Benchmark Test Report

Hardware

Back-end Mock Service Server:

  • CPU: 4 cores and 8 threads Intel Cascade Lake @ 3.0GHz
  • RAM: 16G

Gateway node server:

  • CPU: 4 cores and 8 threads Intel Cascade Lake @ 3.0GHz
  • RAM: 16G

The test tool takes up few resources and is installed on the gateway node server.

ShenYu Version

  • ShenYu Admin: 2.6.0
  • ShenYu Bootstrap: 2.6.0

Test Tool

wrk-4.2.0

Test Case Description

Instruction

  • Use the Mock service to simulate an interface with an average response time of 20ms and about 2k response messages
  • Each test lasts 3 minutes
  • JDK version: OpenJdk-1.8.0
  • The HTTP request side is tested with NettyClient and WebClient respectively
  • Log level is set to WARN
  • Apache ShenYu Bootstrap deploy mode: standalone
  • Apache ShenYu Admin deploy in Back-end Mock Service Server

JVM Configuration

-Xmx 4g 
-Xms 4g
-Xmn 1g
-Xss 512k
-XX: +DisableExplicitGC
-XX: LargePageSizeInBytes=128m

Public Configuration

  • application.yml
matchCache:
selector:
selectorEnabled: true
initialCapacity: 10000 # initial capacity in cache
maximumSize: 10000 # max size in cache
rule:
initialCapacity: 10000 # initial capacity in cache
maximumSize: 65536 # max size in cache
trie:
enabled: true
childrenSize: 10000
pathVariableSize: 1000
pathRuleCacheSize: 1000
matchMode: antPathMatch
netty:
http:
# set to false, user can custom the netty tcp server config.
webServerFactoryEnabled: true
selectCount: 1
workerCount: 8
accessLog: false
serverSocketChannel:
soRcvBuf: 87380
soBackLog: 128
soReuseAddr: false
connectTimeoutMillis: 10000
writeBufferHighWaterMark: 65536
writeBufferLowWaterMark: 32768
writeSpinCount: 16
autoRead: false
allocType: "pooled"
messageSizeEstimator: 8
singleEventExecutorPerGroup: true
socketChannel:
soKeepAlive: false
soReuseAddr: false
soLinger: -1
tcpNoDelay: true
soRcvBuf: 87380
soSndBuf: 16384
ipTos: 0
allowHalfClosure: false
connectTimeoutMillis: 10000
writeBufferHighWaterMark: 65536
writeBufferLowWaterMark: 32768
writeSpinCount: 16
autoRead: false
allocType: "pooled"
messageSizeEstimator: 8
singleEventExecutorPerGroup: true
  file:
enabled: false
maxSize : 10
  cross:
enabled: false
logging:
level:
root: warn
org.springframework.boot: warn
org.apache.ibatis: warn
org.apache.shenyu.bonuspoint: warn
org.apache.shenyu.lottery: warn
org.apache.shenyu: warn
  • logback.xml
    <root level="WARN">
<appender-ref ref="ASYNC_STDOUT"/>
<appender-ref ref="ASYNC_FILE"/>
<appender-ref ref="ASYNC_ERROR_FILE"/>
</root>

WebClient Configuration

httpclient:
strategy: webClient # netty
connectTimeout: 45000 # 45000
responseTimeout: 3000 # 3000
readerIdleTime: 3000 # 3000
writerIdleTime: 3000 # 3000
allIdleTime: 3000 # 3000
readTimeout: 3000 # 3000
writeTimeout: 3000 # 3000
wiretap: false # false
keepAlive: false # false
maxInMemorySize: 1 # 1
pool:
type: ELASTIC # ELASTIC
name: proxy # proxy
maxConnections: 16 # 16
acquireTimeout: 45000 # 45000
maxIdleTime: 3000 # 3000

Netty Client Configuration

httpclient:
strategy: netty # netty
connectTimeout: 45000 # 45000
responseTimeout: 3000 # 3000
readerIdleTime: 3000 # 3000
writerIdleTime: 3000 # 3000
allIdleTime: 3000 # 3000
readTimeout: 3000 # 3000
writeTimeout: 3000 # 3000
wiretap: false # false
keepAlive: false # false
maxInMemorySize: 1 # 1
pool:
type: ELASTIC # ELASTIC
name: proxy # proxy
maxConnections: 16 # 16
acquireTimeout: 45000 # 45000
maxIdleTime: 3000 # 3000

Benchmark Test Results

  • Direct Access to Back-end Test Result
QPS50% latency (ms)75% latency (ms)90% latency (ms)99% latency (ms)平均响应时间(ms)最大响应时间(ms)
28998.2019.8123.7828.2641.2420.92402.90
  • netty
currencyQPS50% latency (ms)75% latency (ms)90% latency (ms)99% latency (ms)平均响应时间(ms)最大响应时间(ms)
600 currency20472.9519.3725.3632.8969.9222.091043.33
800 currency20703.5523.5731.3240.1177.2826.11576.47
1000 currency20979.9129.2137.8647.2380.9131.20860.55
1200 currency21129.8832.4542.4052.6896.1035.061070
  • webClient
currencyQPS50% latency (ms)75% latency (ms)90% latency (ms)99% latency (ms)平均响应时间(ms)最大响应时间(ms)
600 currency18640.4715.7724.7738.2680.3120.32852.06
800 currency18723.4418.1228.6944.9695.323.52765.26
1000 currency18928.9919.9931.4249.09108.8425.931040
1200 currency18965.3722.1034.6254.48122.3128.661075

Direct Access to Back-end Test Result

Test Result

QPS50% latency (ms)75% latency (ms)90% latency (ms)99% latency (ms)Avg response time (ms)Max response time (ms)
28998.2019.8123.7828.2641.2420.92402.90

Screenshot of Test Result

Access to Back-end Services via NettyClient Test Result

Test Result
currencyQPS50% latency (ms)75% latency (ms)90% latency (ms)99% latency (ms)Avg response time (ms)Max response time (ms)
600 concurrency20472.9519.3725.3632.8969.9222.091043.33
800 concurrency20703.5523.5731.3240.1177.2826.11576.47
1000 concurrency20979.9129.2137.8647.2380.9131.20860.55
1200 concurrency21129.8832.4542.4052.6896.1035.061070

Screenshot of Test Result

600 concurrency
800 concurrency
1000 concurrency
1200 concurrency

Access to Back-end Services via WebClient Test Result

Test Result

currencyQPS50% latency (ms)75% latency (ms)90% latency (ms)99% latency (ms)Avg response time (ms)Max response time (ms)
600 concurrency18640.4715.7724.7738.2680.3120.32852.06
800 concurrency18723.4418.1228.6944.9695.323.52765.26
1000 concurrency18928.9919.9931.4249.09108.8425.931040
1200 concurrency18965.3722.1034.6254.48122.3128.661075

Screenshot of Test Result

600 concurrency
800 concurrency
1000 concurrency
1200 concurrency