MongoDB的Namespace

Namespace的长度

  每一个namespace包含的信息中:数据库和collection名字加起来不能超过123字节  

Namespace的数量

namespace的数量限制是namespace文件大小除以628。 一个16MB大小的namespace 文件可以支持24000个namespace。 每一个collection或索引对应使用一个namespace。

Namespace文件的大小

Namespace文件大小截止目前不能超过2047MB。 默认情况下namespace文件是16MB,可以通过nsSize选项来指定其大小。 storage.nsSize Type: integer Default: 16 Specifies the default size for namespace files, which are files that end in .ns. Each collection and index counts as a namespace. Use this setting to control size for newly created namespace files. This option has no impact on existing files. The maximum size for a namespace file is 2047 megabytes. The default value of 16 megabytes provides for approximately 24,000 namespaces. The storage.nsSize option is available only for mongod.