title: Uncaught exception 'MongoCursorException' with message 'localhost:27017: DBClientBase::findN: transport error
body: <p>i have used this website for years but this is my first time asking a question, so feel free to correct me if i don't do it right.</p>
  
  <p>We are running into this problem a lot lately.
  We have mongos running one multiple Centos5 servers connecting to sharded replicaset mongodb servers running 2.4.9.</p>
  
  <p>Recently we did a lot of optimization which increased our throughput and while this problem used to happen a lot before, it's now become intolerable.</p>
  
  <p>After certain number of successful read requests the php just errors out and throws same error over and over. After awhile it can recover. This seems to be on per-app server basis and does not affect all app servers at the same time.</p>
  
  <p>If I pkill mongo and start a new mongos connection, this is usually fixed.
  any idea on which direction to dig in or maybe pointers are appreciated, thanks.
  this is the error we get:</p>
  
  <pre><code>Fatal error: Uncaught exception 'MongoCursorException' with message 'localhost:27017: DBClientBase::findN: transport error: internal-mongo-r1-d2-dev.myserver.com:27017 ns: admin.$cmd query: { setShardVersion: "", init: true, configdb: "internal-mongo-c1-dev.myserver.com:27019,internal-mongo-c2-dev.myserver.com:27019,internal-mongo-c3-dev.myserver.com:27019", serverID: ObjectId('52f57ce26ca6543144b077e5'), authoritative: true }' in /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/mongo/mongo.inc:185
  Stack trace:
  #0 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/mongo/mongo.inc(185): MongoCursor-&gt;rewind()
  #1 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/data.inc(62): MongoCG::get(Array)
  #2 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/data/session/savedsession.inc(30): Data::select('mongo', 'coll_saved_sess...', '_id', 'updated_ss', Array, Array)
  #3 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/data/session/savedsession.inc(20): SavedSession::select(Array)
  #4 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/access/phpsession.inc(32): SavedSession::get_one('fl0uq0nqjbbo4iq...')
  #5 [internal function]: PhpSession::read('fl0uq0nqjbbo4iq...')
  #6 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/access/phpsession.inc(16): session_start()
  #7 /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/allinc.inc(15): PhpSession::start()
  #8 /mnt/home/webapps/cgs-sys/releases/20140207163554/p.php(4): include_once('/mnt/home/webap...')
  #9 {main}
    thrown in /mnt/home/webapps/cgs-sys/releases/20140207163554/includes/db/mongo/mongo.inc on line 185
  </code></pre>