SocketException in Mongo logs

mongodb

We are running mongo for 4 months so far , But lately I am seeing a lot of

SocketException handling request, closing client connection: 9001 socket exception [2] server [127.0.0.1:58996]

How can I know the cause of this error ? Is it related to code issue or administrator configuration?

We have Fedora 16 server , mongo version 2.0.7

Best Answer

First off, take a look and follow the steps outlined here:

http://www.mongodb.org/display/DOCS/Troubleshooting#Troubleshooting-Socketerrorsinshardedclustersandreplicasets

Next, look for any ulimit issues on the target host (a new file descriptor is required for a new socket and can cause the error):

http://www.mongodb.org/display/DOCS/Too+Many+Open+Files

Finally, there are a couple of issues related to idle connections being used when they should not be, and that can also contribute to this type of issue:

https://jira.mongodb.org/browse/SERVER-5793

Until SERVER-5632 is complete, the only remedy here is to flush the connections by restarting the mongod/mongos processes.

Related Topic