Too many files open exception


#1

I was using spymemcached client, and since our application uses Websphere MessageBroker where we access the cache, each request is a new thread, so we ran into trouble. The spymemcached client does not do connection pooling so we ran out of connections. Upping the open file count for user and process extended it a bit and still we had to catch the errors and restart more often than we liked.

So the question is, does couchbase have a connection pool or should we do client.shutdown() for each thread destruction?

MO


#2

Hello,

Couchbase Java client has a “connection pool”, to be exact it is not a pool of connection but a non blocking API based on Netty, so you just need a singleton per VM

Regards
Tug
@tgrall


#3

Yes a singleton was the solution.

Thanks.


#4

just like change "client = new CouchbaseClient((CouchbaseConnectionFactory) cf);"
to “client = getInstance((CouchbaseConnectionFactory) cf);”??


#5

so we don’t have shundown the CouchbaseClient everytime?


#6

so if the CouchbaseClient is singleton,we can’t shutdown the client,right?