How can we use persistent connections to memcached servers using xmemcached or spymemcached? I am presently using xmemcached.
MemcachedClientBuilder builder = new XMemcachedClientBuilder(
AddrUtil.getAddresses(
"127.0.0.1:11211 127.0.0.1:11311"
)
);
builder.setConnectionPoolSize(5);
With this code I tried to create connection pool and I used ss command to watch the connections being made. However, I can see that when program terminates connections go to time-wait state and next time I run it, more connections are created. So this is not working. What am I missing? Or what can be done in this case? Please help