I have been testing spymemcached and xmemcached clients. I have been trying to find answers in the projects documentation but it is very poor.
My questions are regarding opening, closing and reusing the connections. I found this in one document:
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".
Spymemcached doesn't provide a connection pool, so every time I create a MemcachedClient
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?
xmemcached does have a connection pool. In this case should I close connections I get from the pool?