How to properly increase ulimit -n on Lion?
来源:互联网 发布:手机美发软件 编辑:程序博客网 时间:2024/04/30 14:54
Which command / configuration file controls the open file limits on OS X? Is there a different command for OS X 10.5 / 10.6 / 10.7? The options I explore below areulimit
, sysctl
, and launchctl
"Too many open files" is apparently a common error on Leopard, perhaps other versions of OS X:
https://discussions.apple.com/thread/1449787?start=15&tstart=0
How to properly increase ulimit -n on Lion?
http://serverfault.com/questions/15564/where-are-the-default-ulimits-specified-on-os-x-10-5
There are many (related?) ways to view the open file limits:
$ ulimit -acore file size (blocks, -c) 0data seg size (kbytes, -d) unlimitedfile size (blocks, -f) unlimitedmax locked memory (kbytes, -l) unlimitedmax memory size (kbytes, -m) unlimitedopen files (-n) 2048pipe size (512 bytes, -p) 1stack size (kbytes, -s) 8192cpu time (seconds, -t) unlimitedmax user processes (-u) 512virtual memory (kbytes, -v) unlimited$ launchctl limitcpu unlimited unlimited filesize unlimited unlimited data unlimited unlimited stack 8388608 67104768 core 0 unlimited rss unlimited unlimited memlock unlimited unlimited maxproc 1024 2048 maxfiles 2048 4096 $ sysctl -a | grep fileskern.maxfiles = 32768kern.maxfilesperproc = 16384kern.maxfiles: 32768kern.maxfilesperproc: 16384kern.num_files: 2049
It has been claimed in some of the above posts that these can be modified with the following commands:
sudo launchctl limit maxfiles 16384 32768sudo ulimit -n 32768sudo sysctl -w kern.maxfilesperproc=16384sudo sysctl -w kern.maxfiles=32768
However, out of the above commands, only the sysctl
commands have any apparently effect (i.e. ulimit -n
and launchctl limit
show no change after the above commands have been entered, while sysctl -a
does show the requested changes).
The corresponding locations to change these parameters for the OS are:
/etc/sysctl.conf/etc/launchd.conf
(discovered one answer: ulimit
only controls the current shellhttp://superuser.com/questions/302754/increase-the-maximum-number-of-open-file-descriptors-in-snow-leopard)
sudo launchctl limit maxfiles 16384 65536sudo ulimit -n 65536sudo sysctl -w kern.maxfilesperproc=65536sudo sysctl -w kern.maxfiles=65536
- How to properly increase ulimit -n on Lion?
- How to Virtualize OS X Lion on Windows
- How to close resources properly
- How to properly unblock libusb_bulk_transfer
- How to Increase Your Professional Reputation
- How to increase MySQL memory limit?
- How to properly convert SecureString to String
- How to restore deleted chrome bookmarks on Mac 10.7.3 Lion
- How to Install mcrypt for php on Mac OSX Lion 10.8 & 10.7 Development Server
- how to display chinese character properly
- How to set Android camera orientation properly?
- How to properly address PHP_Incomplete_Class issue
- How to Disable Visual Styles to Increase Performance
- How to use bonding to increase the throughput?
- How to increase VirtualBox Guest host Screen Size
- How to Increase CSS Misscount in single instance ASM installations
- How to increase MTT Size in Mellanox HCA
- How To get the usbdisk's drive letter properly
- amplxe-cl -help collect-with
- 想要说声抱歉,是否听得到
- java regex document
- amplxe-cl -help command
- JSP 中的消息框:警告框、确认框、提示框
- How to properly increase ulimit -n on Lion?
- xhprof管理
- MSSOAP30.DLL VC 报错问题 MSSOAP30.DLL 3.0下载 MSSOAP30.DLL 3.0.1325.0 vc xp
- 根据进程令牌来完成计算机之间文件拷贝
- Vtune how to use?
- 无
- 史前被踩之最→貼子! ~...~
- Attributes Layout
- 关于学习Linux的经典书籍 (深入理解Linux内核、Linux设备驱动程序等)