How to set maxfiles resource hard limit to unlimited(Max number of files that can be opened by a process)
How to set maxfiles resource hard limit to unlimited(Max number of files that can be opened by a process)
- Subject: How to set maxfiles resource hard limit to unlimited(Max number of files that can be opened by a process)
- From: gaurav dewan <email@hidden>
- Date: Tue, 15 May 2012 14:13:01 +0530
Hi all,
When we install mac OS from lab image, max number of open files for process getrlimit hard limit is unlimited and soft limit is 256 (snowleopard and lion).
Given a MAC machine where hard limit for max number of open files is not unlimited(for example using the command below or due to some unidentified launch daemon/agent/config), is there a way we can reset it back to unlimited?
sudo launchctl limit maxfiles 10000
//changes the hard and soft limit for maxfiles to 10000 instead of unlimited
sudo launchctl limit maxfiles unlimited : This Does not work as Mac OS expects that argument for maxfiles must be numeric and not “unlimited” although unlimited works for other resources like core
Documentation for setrlimit
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/setrlimit.2.html#//apple_ref/doc/man/2/setrlimit
A good discussion at:
http://lists.apple.com/archives/unix-porting/2010/Sep/msg00001.html
As 2^63-1 = 9223372036854775807
launchctl limit maxfiles 9223372036854775807
//Does not work as this command does not like a value greater than 32 bit 2147483647- why can't we enter 64 bit integer on terminal?
sysctl and ulimit commands do not help.
How can users control this setting at time of installation and after installation to change it to unlimited? (given superuser permission)
Are these limitations related to bugs in kernel?
Thanks
Gaurav
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden