When my MongoDB connection is idle for a few minutes, the next request ends in error. From the mongo
command line client, it looks like this:
&g
You want to look at the docs for the Server object
http://mongodb.github.com/node-mongodb-native/api-generated/server.html#server
Especially the socketOptions where you can set keepAlive and the connection timeouts. By default keepalive is off and timeout is 0 or never which means the os default socket timeout is in effect (varies from os to os). Keep alive will send a packet once in awhile down the tcp socket connection to keep it alive. Sometimes firewalls are badly configured and don't send an end packet when they close a connection leaving the connection dead and in limbo which is what the monoglabs people are talking about (more often than not to be honest they are horribly configured).