Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increasing MongoDB namespace limits

I have a MongoDB replica set of 3 instances running and recently I got the following errors in the log file:

error: hashtable namespace index max chain reached:1335
warning: hashtable namespace index long chain
ERROR: writer worker caught exception: too many namespaces/collections on: ...

This looks to me like the default .ns (namespace file) size limit isn't enough here so I included:

nssize = 32

to the configuration of each replica set member.

This is supposed to make the namespace files 32MB now instead of default 16MB (see http://docs.mongodb.org/manual/reference/configuration-options/#storage.nsSize).

Questions:

  1. How do I rebuild the existing namespace files to have the new limit taken into account? Restarting mongod server didn't seem to work.
  2. Is there anything else I should do apart from changing this limit to get rid of such errors?
like image 811
schedar Avatar asked Jul 11 '26 01:07

schedar


1 Answers

How do I rebuild the existing namespace files to have the new limit taken into account? Restarting mongod server didn't seem to work.

You will need to recreate your database in order for this to take effect until: https://jira.mongodb.org/browse/SERVER-385 is around.

Is there anything else I should do apart from changing this limit to get rid of such errors?

Not really, other than make it bigger than 32MB?

For reference here is 10gen talking about the error: https://groups.google.com/forum/#!topic/mongodb-user/YrPqM85N4Mk and what to do, they essentially come to the same conclusion as you have: watch the number of collections.

like image 172
Sammaye Avatar answered Jul 14 '26 16:07

Sammaye