spymemcache - MemcachedClient 是否具有内置连接池?

spymemcache - Does MemcachedClient has a built-in connection pool?

我正在使用 memcached,并使用 Java spymemcache 连接它。

我的问题是:

MemcachedClient是否有内置连接池?

我可以重用 class 的实例在 memcached 上进行并发操作,还是每次需要时都需要创建一个新实例?

来自文档:

Each MemcachedClient instance establishes and maintains a single connection to each server in your cluster.
There is only one thread for all processing. Regardless of the number of requests, threads using the client, or servers to which the client is connected, only one thread will ever be allocated to a given MemcachedClient.

可以在此处找到更多详细信息 https://code.google.com/p/spymemcached/wiki/Optimizations

在我们的一个项目中,为了实现连接池,我们初始化了一个 MemcachedClient 列表(大小为 50),并在进行 get 或 put 调用时随机使用其中一个。