On Fri, Feb 18, 2011 at 1:24 AM, YUNG-LIN HO <[email protected]> wrote:
> Because zookeeper clients will try to keep session alive by sending a ping > request every 2 seconds. If libraries in an application do not share > connections with each other, they would flood the zookeeper server with > unnecessary requests and drag down performance of the server. > Make sure that you have a valid reason to worry first. Do you have thousands of clients? If not, these keep-alives are likely to be undetectable, load-wise. > I am wondering is there any connection manager exists in the > Hadoop/Zookeeper project that helps users to share connections? > Yes. Zookeeper. Just open a single connection and pass it around via a singleton of some kind or your favorite dependency injection technique. This isn't always a great idea since your disconnect and expiration strategies might differ between different uses in important ways.
