Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to increase ulimit max open files, permanently?

I have a shell script that needs to be able to receive hundreds of incoming socket connections. The default max of open files is 256. Strangely, if I run:

sudo ulimit -n 800

...ulimit -a still shows just 256 max open files. If I become root (sudo su), then I can increase the max files to 800, but that setting only remains while I'm root user.

Anyone know how to increase the max open files setting for my regular user name, as I run scripts from the Terminal bash shell?

...Rene

MacBook Pro, Mac OS X (10.6.1)

Posted on Oct 21, 2009 9:33 AM

Reply
1 reply

Oct 21, 2009 9:38 AM in response to Rene Fournier

Wow, within 2 minutes, I realized what I had to do, so in case anyone else wonders the same, here's the solutions:

Just edit the .bash_profile file in your home directory (create it if it's not already there), and add the line:

ulimit -n 1024

Now, whenever you start terminal, that process will be able to open up to 1024 files or socket connections.

...Rene

How to increase ulimit max open files, permanently?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.