rtcontrib - setting maximum number of open files on OSX 10.6.8

Hi Michael,
I don't really know anything about launchd.conf, but I can explain why 'sudo ulimit -n 4096' doesn't work. ulimit applies to the shell instance in which it is called. When you use sudo you are essentially creating a shell with root permissions to execute the command. When the command is finished the shell is terminated. You are effectively changing the properties for a temporary shell, not the one you are trying to use.

Does your user account have admin priveliges? You can give admin privileges in the system preferences. If you have admin privileges than you should be able to use ulimit.

Andy

···

On Jul 20, 2011, at 12:01 PM, Michael Martinez wrote:

My second question is for Radiance users running OSX. I'm having trouble setting the maximum number of open files to more than 1024. I'm running OSX 10.6.8, and there seems to be two ways to change the maximum number of open files - one using ulimit and one using launchctl.

In .bash_profile I have this line:

ulimit -S -n 4096

In etc/launchchd.conf I have this:

limit maxfiles 4096
sysctl -w kern.maxfiles=4096

and in etc/sysctl.conf I have:

kern.maxfiles=4096 kern.maxfilesperproc=4096

In a terminal line, when I enter launchctl limit I see this:

        cpu unlimited unlimited
        filesize unlimited unlimited
        data unlimited unlimited
        stack 8388608 67104768
        core 0 unlimited
        rss unlimited unlimited
        memlock unlimited unlimited
        maxproc 266 532
        maxfiles 4096 4096

Which is good. 4096 is more than the 2306 files I want rtcontrib to talk to at the same time.

But then, looking at ulimit -a in a terminal, I see this:

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 266
virtual memory (kbytes, -v) unlimited

Which is bad - 1024 is less than the 2306 files I want rtcontrib to talk to at the same time. Its also surprising given that it should be set to 4096 by .bash_profile.

Then when I try ulimit -n 4096, I get this:

bash: ulimit: open files: cannot modify limit: Operation not permitted

If I use sudo, it takes the command, but when I look at ulimit -a again, the open files limit still says 1024, and despite what launchctl limit says, 1024 is the governing number of maximum open files.

Has anyone out there had success setting this in OSX 10.6 or higher? Or has anyone updated to 10.7 (just released today) and had success?

Many thanks,
Michael

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Thanks a bunch for the replies so far.

Jack - OSX doesn't seem to have a limits.conf configuration file...

David - switching the .bash_profile line in my home folder from "ulimit -S -n 4096" to "ulimit -n 4096" didn't make the change..

Andy - thanks for the sudo explanation - that makes sense as to why it's not making the change. I do have admin privileges, but for some reason I still can't get ulimit to change the limit over 1024.

Oddly enough, I can get ulimit to lower the maximum number of open files, something like ulimit -n 512 works fine and changes the setting. What I can't do is then increase back to 1024 - I get the 'operation not permitted' message. When I restart my machine, the limit returns to 1024. I can use ulimit and lower it to 1023, but even when I try ulimit -n 1025, I still get the message:
bash: ulimit: open files: cannot modify limit: Operation not permitted

···

On Jul 20, 2011, at 12:31 PM, Andy McNeil wrote:

Hi Michael,
I don't really know anything about launchd.conf, but I can explain why 'sudo ulimit -n 4096' doesn't work. ulimit applies to the shell instance in which it is called. When you use sudo you are essentially creating a shell with root permissions to execute the command. When the command is finished the shell is terminated. You are effectively changing the properties for a temporary shell, not the one you are trying to use.

Does your user account have admin priveliges? You can give admin privileges in the system preferences. If you have admin privileges than you should be able to use ulimit.

Andy

On Jul 20, 2011, at 12:01 PM, Michael Martinez wrote:

My second question is for Radiance users running OSX. I'm having trouble setting the maximum number of open files to more than 1024. I'm running OSX 10.6.8, and there seems to be two ways to change the maximum number of open files - one using ulimit and one using launchctl.

In .bash_profile I have this line:

ulimit -S -n 4096

In etc/launchchd.conf I have this:

limit maxfiles 4096
sysctl -w kern.maxfiles=4096

and in etc/sysctl.conf I have:

kern.maxfiles=4096 kern.maxfilesperproc=4096

In a terminal line, when I enter launchctl limit I see this:

        cpu unlimited unlimited
        filesize unlimited unlimited
        data unlimited unlimited
        stack 8388608 67104768
        core 0 unlimited
        rss unlimited unlimited
        memlock unlimited unlimited
        maxproc 266 532
        maxfiles 4096 4096

Which is good. 4096 is more than the 2306 files I want rtcontrib to talk to at the same time.

But then, looking at ulimit -a in a terminal, I see this:

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 266
virtual memory (kbytes, -v) unlimited

Which is bad - 1024 is less than the 2306 files I want rtcontrib to talk to at the same time. Its also surprising given that it should be set to 4096 by .bash_profile.

Then when I try ulimit -n 4096, I get this:

bash: ulimit: open files: cannot modify limit: Operation not permitted

If I use sudo, it takes the command, but when I look at ulimit -a again, the open files limit still says 1024, and despite what launchctl limit says, 1024 is the governing number of maximum open files.

Has anyone out there had success setting this in OSX 10.6 or higher? Or has anyone updated to 10.7 (just released today) and had success?

Many thanks,
Michael

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

blarg!

It's always in the last place you look... and after you email the radiance list.

I needed to add ulimit -n 4096 to .bashrc in my home directory as well...

···

On Jul 20, 2011, at 12:31 PM, Andy McNeil wrote:

Hi Michael,
I don't really know anything about launchd.conf, but I can explain why 'sudo ulimit -n 4096' doesn't work. ulimit applies to the shell instance in which it is called. When you use sudo you are essentially creating a shell with root permissions to execute the command. When the command is finished the shell is terminated. You are effectively changing the properties for a temporary shell, not the one you are trying to use.

Does your user account have admin priveliges? You can give admin privileges in the system preferences. If you have admin privileges than you should be able to use ulimit.

Andy

On Jul 20, 2011, at 12:01 PM, Michael Martinez wrote:

My second question is for Radiance users running OSX. I'm having trouble setting the maximum number of open files to more than 1024. I'm running OSX 10.6.8, and there seems to be two ways to change the maximum number of open files - one using ulimit and one using launchctl.

In .bash_profile I have this line:

ulimit -S -n 4096

In etc/launchchd.conf I have this:

limit maxfiles 4096
sysctl -w kern.maxfiles=4096

and in etc/sysctl.conf I have:

kern.maxfiles=4096 kern.maxfilesperproc=4096

In a terminal line, when I enter launchctl limit I see this:

        cpu unlimited unlimited
        filesize unlimited unlimited
        data unlimited unlimited
        stack 8388608 67104768
        core 0 unlimited
        rss unlimited unlimited
        memlock unlimited unlimited
        maxproc 266 532
        maxfiles 4096 4096

Which is good. 4096 is more than the 2306 files I want rtcontrib to talk to at the same time.

But then, looking at ulimit -a in a terminal, I see this:

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 266
virtual memory (kbytes, -v) unlimited

Which is bad - 1024 is less than the 2306 files I want rtcontrib to talk to at the same time. Its also surprising given that it should be set to 4096 by .bash_profile.

Then when I try ulimit -n 4096, I get this:

bash: ulimit: open files: cannot modify limit: Operation not permitted

If I use sudo, it takes the command, but when I look at ulimit -a again, the open files limit still says 1024, and despite what launchctl limit says, 1024 is the governing number of maximum open files.

Has anyone out there had success setting this in OSX 10.6 or higher? Or has anyone updated to 10.7 (just released today) and had success?

Many thanks,
Michael

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general