Increase rlimit Mac OSX 10.8

末鹿安然 提交于 2019-12-06 00:26:42

问题


I'm learning MongoDB and when I start the mongo shell a wild warning message appeared. It says:

How do i change the "soft rlimits". I'm using Mac OSX 10.8.2

Tnx in advance


回答1:


What you are searching for is launchctl limit maxfiles.
To change it you need to run command launchctl limit maxfiles 1024 2048 for example.
To permanently change those values you need to create /etc/launchctl.conf and set there values you need (see here for details) or add command mentioned above to your ~/.bash_profile.
Or you can create script which will set limit and then launch mongo




回答2:


If you run mongo as a service, you can configure the max open files by adding the next lines to the

/Library/LaunchDaemons/org.mongodb.mongod.plist

  <key>SoftResourceLimits</key>
  <dict>
    <key>NumberOfFiles</key>
    <integer>1024</integer>
  </dict>

and restart the service




回答3:


Having faced similar issues, and after a lot of searches, I found this answer useful.

This gist explains how to address this issue via dedicated launch files as well as session only changes.



来源:https://stackoverflow.com/questions/15939885/increase-rlimit-mac-osx-10-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!