omnip620 / node-zookeeper-dubbo

A middleware helps node to communicate dubbo by using its default protocol, which is registered in zookeeper
300 stars 80 forks source link

调用服务的时候每次都建立一个socket连接问题 #15

Open sammiewy opened 8 years ago

sammiewy commented 8 years ago

调用服务的时候每次都建立一个socket连接,var client = new net.Socket(); 这样子是不是可能把dubbo提供的服务端口都占满?

omnip620 commented 8 years ago

不会的 请求结束后 socket链接就关闭了

Sent from my iPhone

On Aug 29, 2016, at 20:16, sammie notifications@github.com wrote:

调用服务的时候每次都建立一个socket连接,var client = new net.Socket(); 这样子是不是可能把dubbo提供的服务端口都占满?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

nupthale commented 8 years ago

高并发的情况下,每次都new socket; 是不是应该维护一个socket连接池,保证socket数量不会太多?

omnip620 commented 8 years ago

@nupthale 好 非功能性优化 会放在计划里

eurekao commented 8 years ago

使用dubbo协议的,官方推荐每服务每提供者每消费者使用单一长连接,那么是不是只维护一个socket连接更合理?

omnip620 commented 8 years ago

@eurekao 是的 后期会加上的