java api: "Out of semaphores to get db connection"

1,317 views
Skip to first unread message

MartinG

unread,
Jul 8, 2010, 4:38:32 AM7/8/10
to mongodb-user
Hi,

Using the java api, I am seeing this error when attempting many
simultaneous operations:

com.mongodb.DBPortPool$SemaphoresOut: Out of semaphores to get db
connection
at com.mongodb.DBPortPool.get(DBPortPool.java:136)
at com.mongodb.DBTCPConnector$MyPort.get(DBTCPConnector.java:249)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:175)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:277)
at com.mongodb.DBCursor._check(DBCursor.java:250)
at com.mongodb.DBCursor._hasNext(DBCursor.java:371)
at com.mongodb.DBCursor.hasNext(DBCursor.java:396)

This looks like something like a connection pool becoming exhausted,
but I would expect it to block until one is available, rather than
erroring.

I am using mongo-java-driver-2.0.jar

Can anyone help?

Eliot Horowitz

unread,
Jul 8, 2010, 10:22:27 AM7/8/10
to mongod...@googlegroups.com
There is a limit to how many threads it willing to let block.
This is configurable using MongoOptions

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

JonW

unread,
Jul 29, 2010, 12:40:29 PM7/29/10
to mongodb-user
Is this configurable at the server level?

thx.

On Jul 8, 7:22 am, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> There is a limit to how many threads it willing to let block.
> This is configurable using MongoOptions
>
> On Thu, Jul 8, 2010 at 4:38 AM, MartinG <gar...@gmail.com> wrote:
> > Hi,
>
> > Using the java api, I am seeing this error when attempting many
> > simultaneous operations:
>
> > com.mongodb.DBPortPool$SemaphoresOut: Out ofsemaphoresto get db

Eliot Horowitz

unread,
Jul 29, 2010, 12:44:24 PM7/29/10
to mongod...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages