lua-resty-http 连接池中的连接不复用和关闭问题

562 views
Skip to first unread message

xue

unread,
Jun 11, 2020, 9:57:06 AM6/11/20
to openresty
https://github.com/ledgetech/lua-resty-http


服务器4core,下面代码连接池设置20,性能测试一轮过后,剩下的 keepalive长连接应为80,但实际超过80,达到100多,且下次一轮再调用时,长连接数量在100多的基础上还上升....一直上升。



local function query_from_server(url)
    
    local http = require "resty.http"
    local httpc = http.new()
    httpc:set_timeout(3000)
    local res, err = httpc:request_uri(url, {
        version = 1.1,
        method = "GET",
        keepalive = true,
        keepalive_pool = 20,
        keepalive_timeout = 60000
    })
    return res, err
end

xue

unread,
Jun 11, 2020, 11:53:08 AM6/11/20
to openresty

Connection Pool not working and not reused ! #214


 

 version 0.12/0.14

The problem is the same.....

DeJiang Zhu

unread,
Jun 21, 2020, 9:41:40 AM6/21/20
to open...@googlegroups.com
看起来是这个 resty.http 没有加入 backlog 的配置参数
cosocket 如果没有 backlog 的话,是会出现超过连接池大小的连接数的


xue <yangu...@gmail.com> 于2020年6月11日周四 下午11:53写道:
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/e2d30651-497b-4e3e-ac1e-592bb192eeaco%40googlegroups.com
Reply all
Reply to author
Forward
0 new messages