PDA

View Full Version : How Can I Change "ulimit" From Command Line In Linux?



pieeyed
02-26-2009, 07:06 PM
Can I change the ulimit value from the command
line? I've tried: ulimit -n 11000 and it works but
it switches back to 1024 right away.

I've tried logged in as root using putty and logged
in as myself using:

su
password
ulimit -n 11100

Either way it won't stay.

Any suggestions?

Thanks,

Pieeyed

FransTormer
02-26-2009, 07:26 PM
ulimit works in increments of 1024, I believe.

So could you try "ulimit -n 10240"?

pieeyed
02-26-2009, 07:40 PM
Thanks, I tried it but it still goes back to 1024:(

Pieeyed

FransTormer
02-26-2009, 07:46 PM
To increases the number of open files to 90000 for the root account do the following: Edit the .bashrc file vi /root/.bashrc and add the following line:

ulimit -n 90000


You must exit from your terminal and re-login for the change to take effect.

/edit: I'm no Linux-guy so this might be different on certain distro's.

In older 2.2 kernels, though, the number of open files per process is still limited to 1024, even with the above changes.