ITADN
Kong/kong/Issues

Why does the overall average response time for long connections (keep-alive) exceed that for short connections (close) in performance tests?

#14824Openfairyqb 创建于 2026-01-20
F
fairyqbcommented
### Is there an existing issue for this? - [x] I have searched the existing issues ### Kong version (`$ kong version`) kong 3.5.0 ### Current Behavior Why does the overall average response time for long connections (keep-alive) exceed that for short connections (close) in performance tests? Why is this? average response time: 14.01ms > 9.76ms (keepalive > close) average response time: 14.01ms > 9.76ms (keepalive > close) ### Expected Behavior Long connections perform better than short connections. ### Steps To Reproduce command: 1.post 500KB,connection:keepalive wrk -t8 -c16 -d1m -s post.lua --latency --timeout 5s http://10.129.9.39:5074/user (kong) 2. post 500KB,connection:close wrk -t8 -c16 -d1m -s post_close.lua --latency --timeout 5s http://10.129.9.39:5074/user (kong) client post 500KB, server returned the string "ok". post.lua ``` wrk.method = "POST" wrk.headers["Content-Type"] = "application/json" wrk.headers["Connection"] = "keep-alive" local file = io.open("/root/tls/500kb.json", "rb") wrk.body = file:read("*all") file:close() ``` post_close.lua ``` wrk.method = "POST" wrk.headers["Content-Type"] = "application/json" wrk.headers["Connection"] = "close" local file = io.open("/root/tls/500kb.json", "rb") wrk.body = file:read("*all") file:close() ``` ### Anything else? <img width="1321" height="558" alt="Image" src="https://github.com/user-attachments/assets/a7fe3656-5903-41cd-aef0-c7bead5bcecb" />
0 条评论