title: Mongodb error failed 24 : Too many open files : Using pymongo
body: <p>My code is creating pretty heavy traffic, with lots of find, update, map reduce and createIndex operations, so I am not sure which one can be the culprit, but  I am getting the following error: </p>
  
  <pre><code>_create_global_word_frequency_collection
      full_response=True)
    File "/Users/arj/anaconda/lib/python2.7/site-packages/pymongo/collection.py", line 1857, in map_reduce
      sock_info, cmd, slave_ok, ReadPreference.PRIMARY)
    File "/Users/arj/anaconda/lib/python2.7/site-packages/pymongo/collection.py", line 205, in _command
      read_concern=read_concern)
    File "/Users/arj/anaconda/lib/python2.7/site-packages/pymongo/pool.py", line 211, in command
      read_concern)
    File "/Users/arj/anaconda/lib/python2.7/site-packages/pymongo/network.py", line 100, in command
      helpers._check_command_response(response_doc, msg, allowable_errors)
    File "/Users/arj/anaconda/lib/python2.7/site-packages/pymongo/helpers.py", line 196, in _check_command_response
      raise OperationFailure(msg % errmsg, code, response)
  pymongo.errors.OperationFailure: command SON([('mapreduce', u'verbatimterms'), ('map', Code('\n                    function(){\n                        this.terms.forEach(function(item){\n                        emit(item, 1)\n                    })\n                }\n                ', {})), ('reduce', Code('\n                    function(key, counts){\n                        return Array.sum(counts)\n                    }\n                ', {})), ('out', SON([('replace', 'reconversations_topic_3'), ('db', 'wcterms')])), ('query', {'topic': 'reconversations_topic_3'})]) on namespace indexes.$cmd failed: 24: Too many open files
  </code></pre>
  
  <p>What could be the reason for such an error? </p>