官术网_书友最值得收藏!

Understanding the limitation of a 32-bit version of MongoDB

If you want to deploy MongoDB in a production environment, it's necessary that you use a 64-bit version and not a 32-bit one. In the 32-bit version, MongoDB has the limitation of storage size, that is, you cannot store datasets more than 2 GB.

While using a 32-bit version, if the database storage is more than 2 GB, you will get an error, and you can't start the server till the time you remove your data or migrate your database to a 64-bit version of MongoDB.

The Unix limitation

Most of the Unix family systems such as OS X and Linux provide a method to limit the amount of resources that each user and process can use at the moment. The ulimit function is responsible for managing and applying this limitation.

When the mongod or mongos processes reach the limitation, some errors will show up and the MongoDB server will crash at that moment. You can simply change the limitation using the ulimit function.

Both mongod and mongos instances need to connect to other nodes, members and clients, so it's recommended that you change the limitation manually to prevent problems in the production and for high throughput.

By using the ulimit -a command, you can see the limitations. The following screenshot is an example of using this command:

The Unix limitation

The ulimit command shows you the limitation per user. So, if you run the mongod or mongos instances as a user, you will realize that these processes might reach this limitation.

Note

Note that the processes' value (that is, -u) refers to the combined number of distinct processes and subprocess threads. This can be accessed at http://docs.mongodb.org/manual/reference/ulimit/.

To change the limitation, you can simply use the following command:

ulimit -a 256 

After changing the limitation, its better to restart the mongod or mongos instances to apply the limitation.

The following is the recommended setting for the mongod and mongos processes from the MongoDB documentation page at http://docs.mongodb.org/manual/reference/ulimit/. The settings are set using the following command:

-f (file size): unlimited 
-t (cpu time): unlimited 
-v (virtual memory): unlimited
-n (open files): 64000 
-m (memory size): unlimited
-u (processes/threads): 32000
主站蜘蛛池模板: 鄢陵县| 安丘市| 洪雅县| 常州市| 特克斯县| 荃湾区| 保山市| 那坡县| 界首市| 巴彦淖尔市| 顺昌县| 甘孜| 张家界市| 庆安县| 曲靖市| 新巴尔虎左旗| 敦煌市| 潞城市| 威海市| 新干县| 普定县| 怀仁县| 林西县| 高平市| 五河县| 东阿县| 乃东县| 九龙县| 高台县| 育儿| 务川| 洱源县| 玛多县| 白银市| 会宁县| 潼关县| 枣强县| 禄劝| 方城县| 秦皇岛市| 毕节市|