Re: limit command (170 Views)
Reply
Super Advisor
Tarek
Posts: 275
Registered: ‎12-19-2000
Message 1 of 17 (170 Views)
Accepted Solution

limit command

A user asked me to modify some parameters of the limit command. I haven't understood yet what kind of parameters are, but they seem to be concerning shell and not kernel..is it right?? I saw that i can configure them in my .cshrc. However i tried to configure the datasize, which actually is set to 2015464 to unlimited but it doesn't work. Why? On another hp with same OS (hpux11) there's set (i think by default), datasize to unlimited.
This is the entry i have now:
cputime unlimited
filesize unlimited
datasize 2015464 KB
stacksize 81612 KB
coredumpsize 2097151 KB
descriptors 200 files
memoryuse unlimited
Can someone explain me what parameters are this? I haven't a man of limit.
Thanks in advance
Tarek
Please use plain text.
Honored Contributor
Sridhar Bhaskarla
Posts: 6,350
Registered: ‎08-15-2001
Message 2 of 17 (170 Views)

Re: limit command

I haven't heard of any command called limit that can be used to limit the resources.

Some the of the terms you listed fall under kernel parameters, Some can be done by PRM (Process Resource Manager).

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Please use plain text.
Honored Contributor
Sanjay_6
Posts: 5,942
Registered: ‎04-15-2001
Message 3 of 17 (170 Views)

Re: limit command

Hi Tarek,

Take a look at the threads below for more info.

http://us-support2.external.hp.com/cki/bin/doc.pl/sid=73945b0c0d02e1f2f0/screen=ckiDisplayDocument?d...

http://us-support2.external.hp.com/cki/bin/doc.pl/sid=73945b0c0d02e1f2f0/screen=ckiDisplayDocument?d...

http://us-support2.external.hp.com/cki/bin/doc.pl/sid=ef13e92906bfcef50f/screen=ckiDisplayDocument?d...

Hope this helps.

Thanks

P.S. : the Spikes from your UPS are not a good sign. You should replace the UPS or get it rectified. That could be the cause of your problem.
Please use plain text.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 4 of 17 (170 Views)

Re: limit command

Hi:

The command you are looking for is 'ulimit'. It is a shell built-in so you need to man csh, or man sh_posix, or man ksh to see what the various settings do. There is also a ulimit system call. Man 2 ulimit for those details.

Typically, the absolute maximum limits are defined in the kernel (like maxdsiz,maxssiz,maxtsiz) these can be further limited by ulimit settings. The rule is that only a super-user can increase a ulimit value but only to the maximum the kernel allows. A regular user can only reduce a current ulimit setting.
If it ain't broke, I can fix that.
Please use plain text.
Honored Contributor
Santosh Nair_1
Posts: 1,020
Registered: ‎07-18-2000
Message 5 of 17 (170 Views)

Re: limit command

I think the user is asking about the ulimit command...not the limit command. In any case, some of these limits can be changed dynamically if you're using the Posix Shell (/usr/bin/sh) or C-Shell (/usr/bin/csh). There are also kernel parameters associated with some of these limits, specifically:

ulimit kernel parameter
datasize maxdsiz
stacksize maxssiz
descripter maxfiles
Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Please use plain text.
Honored Contributor
Sanjay_6
Posts: 5,942
Registered: ‎04-15-2001
Message 6 of 17 (170 Views)

Re: limit command

Hi Tarek,

Sorry abt the earliaer posting. It got posted at the wrong place. It was an answer to some other question.

Sorry abt that.

Please use plain text.
Honored Contributor
Sanjay_6
Posts: 5,942
Registered: ‎04-15-2001
Message 7 of 17 (170 Views)

Re: limit command

Hi Tarek,

Here is a thread for you to look at. Sorry abt the earlier wrong postings.

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90680/B2355-90680_top.htm...

Hope this helps.

thanks
Please use plain text.
Super Advisor
Tarek
Posts: 275
Registered: ‎12-19-2000
Message 8 of 17 (170 Views)

Re: limit command

I'm talking about limit not ulimit.
If i issue ulimit i have this output:
unlimited
If i issue limit, i have the output i've told you about.
Thanks all again.
Please use plain text.
Honored Contributor
Roger Baptiste
Posts: 1,151
Registered: ‎04-17-2000
Message 9 of 17 (170 Views)

Re: limit command

Hi,

The limit command is used to set a limit
on the resources being used by a shell and
the processes it spawns. For instance, if
one wants to limit the size of a core file
which a user process can dump, the limit
command would be handy to do it. Similarly,
the heapsize , max number of files etc can
be configured. The command name and features vary according to the shell.

For C shell, it is the "limit" command;
For K and Bourne shell, it is called "ulimit".

A user cannot increase a limit beyond the
"hard limit" (which is set by default and
can be changed only by the superuser).

>>However i tried to configure the datasize, >>which actually is set to 2015464 to >>unlimited but it doesn't work. Why?

try using limit -h option (-h is for
hard limit).

>>On another hp with same OS (hpux11) there's >>set (i think by default), datasize to >>unlimited.

The shell must be KSH which sets unlimited
by default.

>>This is the entry i have now:
cputime unlimited ->Maximum CPU seconds per process
filesize unlimited ->Largest single file allowed; limited to the size of the filesystem

datasize 2015464 KB -> Heap size
stacksize 81612 KB -> Max stack size
coredumpsize 2097151 KB -> Ah! max coredump
descriptors 200 files -> max open files
memoryuse unlimited ->max virtual mem size
This definitions are at shell level.

Do a man on ulimit or sh to get more details.
In ksh ulimit -a will give the defined values.
Another quirk i have seen is Bourne shell
does not take "unlimited" as an value.

Man on csh and search for limit to get
the options for csh's limit.

HTH
raj
Take it easy.
Please use plain text.
Super Advisor
Tarek
Posts: 275
Registered: ‎12-19-2000
Message 10 of 17 (170 Views)

Re: limit command

Rajman,
your answer was perfect, but i still need more help. You wrote:
A user cannot increase a limit beyond the
"hard limit" (which is set by default and
can be changed only by the superuser).
Where can i change the default settings?
I tried limit -h datasize unlimited but it still didn't work. I also tried limit -h, same output.
Can you help me again or anyone else?
Thanks in advance
Tarek

Please use plain text.
Super Advisor
Tarek
Posts: 275
Registered: ‎12-19-2000
Message 11 of 17 (170 Views)

Re: limit command

limit datasize unlimited
i have this error:
Can't remove limit.
limit -h datasize unlimited
i have no errors but value didn't change.
Please use plain text.
Super Advisor
Tarek
Posts: 275
Registered: ‎12-19-2000
Message 12 of 17 (170 Views)

Re: limit command

please, any further help?
My user is unable to work using a software (Synopsys Cadence) because he needs to change limit datasize value. How can i do?
Regards,
Tarek
Please use plain text.
Honored Contributor
Roger Baptiste
Posts: 1,151
Registered: ‎04-17-2000
Message 13 of 17 (170 Views)

Re: limit command

<i have this error:
Can't remove limit.
limit -h datasize unlimited
i have no errors but value didn't change.>>

Tarek,

The problem is with the Shell command format. CSH and KSH doesnt seem to
take the "unlimited" value to their
limit commands. Whenever i ran into this
problem, i made the User change their
SHell to Bourne shell (/usr/bin/sh or /sbin/sh) and then ran the ulimit
command . This takes the "unlimited" option.
# change the shell of the user (in thepassword file)
# Make sure what the ulimit option you need
to give by doing ulimit -a or ulimit command
# then ulimit


Another thing you can try is , instead
of giving unlimited, give some Large number.
for eg: limit datasize largenumber
or limit -h datasize largenumber

It should take it.

HTH
raj
Take it easy.
Please use plain text.
Super Advisor
Tarek
Posts: 275
Registered: ‎12-19-2000
Message 14 of 17 (170 Views)

Re: limit command

Rajman,
thanks for your help, but it's still not working. The datasize depends from something but i don't know what. With csh on another ws, hpux11 as this, i have datasize unlimited, but here it isn't working. Also in this ws i have cputime, filesize and memoryuse set to unlimited.
I also tried with
limit -h datasize 3000000
output: limit: Value exceeds allowable limit.
User needs to work with csh, so i can't try with limit. I haven't understood a thing. When i issue limit -h it takes default values, right? Where are they set? Is there some file to modify??
Thanks
Tarek
Please use plain text.
Honored Contributor
Roger Baptiste
Posts: 1,151
Registered: ‎04-17-2000
Message 15 of 17 (170 Views)

Re: limit command

Tarek,

The limit command calls
the ulimit system call which
the sets the values. This
values are applicable only
for the process/shell from
which it is called. It is
not global. I don''t think
it is stored in any file.
As for the defaults, they
are derived from the kernel
values.

<>

Datasize is derived from
maxdsiz kernel parameter.
More its value, more the limit
will be for the process.
Check what''s the maxdsiz
for your system and if necessary increase it.
That should increase the limit.

<>

I am not sure whether you
can set datasize as unlimited
becasue there is a finite
limit on the datasize.
Here unlimited could mean
that , use everything available.

<>

Yes, but the limits for
these params do not matter,
because cputime is controlled
by spinlock and cpu allocation
routines; filesize is set
by filesystem; memoryuse
is taken by memory management
system routines.

<limit -h datasize 3000000
output: limit: Value exceeds allowable limit. >>

Ok, that means it exceeds
your maxdsiz; and you cannot
run limit -h as normal user.

<>

Then, you would need to
increase the maxdsiz at kernel.

<< I haven't understood a thing. When i issue limit -h it takes default values, right? Where are they set? Is there some file to modify?? >>

Firstly, make sure what
the user requirement is.
Change the maxdsiz kernel
parm and then see how it
increases the limit defaults.

HTH
raj
Take it easy.
Please use plain text.
Super Advisor
Tarek
Posts: 275
Registered: ‎12-19-2000
Message 16 of 17 (170 Views)

Re: limit command

I think that's it Rajman.
I need again your help, forgive me!!
I found the maxdsiz, but how can i increase it?
There is Formula/Value: 0X7B03A000
Calculated Value: 2063835136
I can only increase Formula/Value. How can i set the maximum value of this parameter, and how can i know which is the maximum value?
Thanks,
Tarek
Please use plain text.
Honored Contributor
Roger Baptiste
Posts: 1,151
Registered: ‎04-17-2000
Message 17 of 17 (170 Views)

Re: limit command


From Docid: A5563482:

For HP-UX 10.20, the maximum data segment size for a process is 944 MB.

For HP-UX 11.0, the maximum data segment size is described below:
32-bit processors:

Minimum: 0x400000 (4 Mbytes)
Maximum: 0x7B03A000 (approx 2 Gbytes)
Default: 0x4000000 (64 Mbytes)

64-bit processors:

Minimum: 0x400000 (4 Mbytes)
Maximum: 4396972769279
Default: 0x4000000 (64 Mbytes

*********

So, yes 2Gb is maximum
Datasegment size you can
set on your system, if the
O/S you are using is 32-bit
(swlist |grep -i runtime will
tell you whether it is 32 or
64 bit o/s).

Try setting it to the
maximum of 2Gb and check.

Once again, make sure of the
user requirements. Many programs do not need that
much of dataseg size. There
is nothing like "unlimited"
dataseg. The vendorsupport
of the application they are
running should be able to
help you.

Changing dataseg will need
a reboot.

HTH
raj
Take it easy.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation