文档上说:
Also note that subrequests just mimic the HTTP interface but there is no extra HTTP/TCP traffic nor IPC involved. Everything works internally, efficiently, on the C level.
我的做法是定义一个redis查询的处理
location = /redis/query {
#Do redis query
}
然后使用capture_multi来合并redis查询
ngx.location.capture_multi({
#query1,
#query2,
#query3
})
问题是这样做会导致大量TIME_WAIT
并且有很多lua tcp socket connect timed out 错误。
我的问题是既然文档是说不会有额外http/tcp为什么会产生这么多TIME_WAIT,是我理解有问题吗?
openresty version: 1.9.7.2