Our service listens to a queue and persists the events in Marklogic-v8.0.6 published to it using the java client.
The persistence code works this way:
client.getConnection(host,port,name,pswd,auth)
write content
client.release
When there are a large number of events say 2000+ , only the first 200 - 250 are persisted.
Then we see exceptions with message Too many open files
and the events are not persisted there after.
This is because there are too many open connections on marklogic and there are no connections for the service to consume.
Is there a connection pool concept in marklogic that can be utilized?
The client object encapsulates a connection pool.
Creating a new client for every request is very inefficient.
The recommended pattern of use is to open one client for the combination of a database and role and to continue to use that client for all access to the database with the role.
The database client and managers are threadsafe after configuration, so multiple threads can use the same database client.
If you find you need more concurrent requests than the default, there are ways to tune that, but the first step is treating the database client as a singleton for the combination of database and role.
Hoping that helps,