Groups
Groups
Sign in
Groups
Groups
openresty
Conversations
Labels
About
Send feedback
Help
Re: [openresty] sock:setkeepalive 连接池使用疑问。
129 views
Skip to first unread message
Yichun Zhang (agentzh)
unread,
Jan 26, 2014, 1:50:00 PM
1/26/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openresty
Hello!
2014/1/26 付海清:
>
> 现在的问题是:连接池总是创建其中一个服务的链接,比如8000端口的服务。后来我在服务端加了
> Thread.sleep(5000)
> 来加大计算时间,然后按住F5一直刷,但是连接池总是创建8000的服务。所以我想问一下:setkeepalive连接池对于生成新的TCP链接是怎么处理的呢?难道不是重新开一个新链接吗?
这和 ngx_lua 一侧的连接池没有关系吧?你的 Lua 客户端只是去连本地的 7000 端口。具体如何分配到你的 tcp {
upstream {} } 里的各个 server 是你使用的 ngx_tcp_proxy 模块控制的。
一般地,建议直接在 Lua 里做你的 TCP 后端服务的负载均衡,这样效率才能最大化,同时也可以很好地控制连接池的粒度。
Regards,
-agentzh
Reply all
Reply to author
Forward
Message has been deleted
0 new messages