On Jul 18, 2012, at 11:45 PM, panfei wrote: > Hi all: > > there maybe a lot of RPC calls from the client to the server, I want to > know , in this case, should I create a transport and keep it opened to do > the RPC calls , or should I create a transport on every RPC call ? and why > ? thanks ! > > > -- > 不学习,不知道
On a *nix system, opening a transport for each RPC call uses a socket. When you close the transport, the system keeps the socket around for a while, so it is unavailable for re-use. Depending on the rate at which you make RPC calls, your system can get starved for sockets, and you will need to add retry logic to handle that. So it's better to open a single client and use it for multiple calls. I'm guessing you would see the same effect from a Windows client. - Rush
