1753400 Members
7343 Online
108792 Solutions
New Discussion юеВ

Re: ulimit parameter

 
SOLVED
Go to solution
Shivkumar
Super Advisor

ulimit parameter

Hi,

I want to change the value of ulimit parameter
as $ulimit -n 4096.

Will this change be permanent or i need to change in some config file to make it permanent ?

Thanks,
Shiv
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: ulimit parameter

Hi Shiv:

The change is not permanent. 'ulimit' is implemented for the shells and can be set for the Posix and Korn shells in '/etc/profile' or '$HOME/.profile'.

You can adjust the values downward from the limits imposed by the kernel, but not upwards of the kernel setting.

The manpages for 'sh-posix' offer more insight.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: ulimit parameter

You will need to change the kernel tunables maxfiles and maxfiles_lim to make the changes "permanent". In any event, maxfiles_lim (the hard limit) must be at least 4096 before ulimit can actually increase the value to 4096.
If it ain't broke, I can fix that.
spex
Honored Contributor

Re: ulimit parameter

# kmtune |grep -e 'maxdsiz' -e 'maxssiz' -e 'maxtsiz' -e 'maxfiles'
maxdsiz 512000000
maxdsiz_64bit 0x0000000040000000
maxfiles 2048
maxfiles_lim 2048
maxssiz 250000000
maxssiz_64bit 1073741824
maxtsiz 250000000
maxtsiz_64bit 0x0000000040000000

maxdsiz is data (in kbytes)
maxssiz is stack (in kbytes)
maxtsiz is text (in kbytes)
maxfiles is # of descriptors

You must recompile the kernel to make changes permanent.

PCS
inventsekar_1
Respected Contributor

Re: ulimit parameter

HI SHiv,
from man sh-posix:
==============================================================

ulimit [-HSacdfnst] [limit]

Set or display a resource limit. The limit for a specified
resource is set when limit is specified. The value of limit can
be a number in the unit specified with each resource, or the
keyword unlimited.

The -H and -S flags specify whether the hard limit or the soft
limit is set for the given resource. A hard limit cannot be
increased once it is set. A soft limit can be increased up to
the hard limit. If neither -H nor -S is specified, the limit
applies to both. The current resource limit is printed when
limit is omitted. In this case, the soft limit is printed unless
-H is specified. When more than one resource is specified, the
limit name and unit are printed before the value.

If no option is given, -f is assumed.

-a List all of the current resource limits.
-c The number of 512-byte blocks in the size of core
dumps.

Hewlett-Packard Company - 18 - HP-UX Release 11i: April 2002

sh-posix(1) sh-posix(1)

-d The number of kilobytes in the size of the data area.
-f The number of 512-byte blocks in files written by child
processes (files of any size can be read).
-n The number of file descriptors.
-s The number of kilobytes in the size of the stack area.
-t The number of seconds to be used by each process.

==============================================================
Be Tomorrow, Today.