title: memcached client: opening, closing and reusing connections
body: <p>I have been testing spymemcached and xmemcached clients. I have been trying to find answers in the projects documentation but it is very poor.</p>
  
  <p>My questions are regarding opening, closing and reusing the connections. I found this in one document:</p>
  
  <blockquote>
    <p>A client may just close the connection at any moment it no longer needs it. Note,
    however, that clients are encouraged to cache their connections rather
    than reopen them every time they need to store or retrieve data. Caching connections will eliminate the overhead associated with establishing a TCP connection".</p>
  </blockquote>
  
  <p>Spymemcached doesn't provide a connection pool, so every time I create a <code>MemcachedClient</code> instance I am creating a new connection right? Then when should I close the connection? Should I provide the same instance to all the threads in my application or create a new one every time?</p>
  
  <p>xmemcached does have a connection pool. In this case should I close connections I get from the pool?</p>