1849830 Members
1925 Online
104044 Solutions
New Discussion

Ulimit

 
John Walker_1
Advisor

Ulimit

Can anyone advise where I would set a file size limit using 'ulimit' / UL_SETFILESIZE.
I have an issue where a file has a limit of 32Mb but I need it to be allowed to grow bigger than this.
8 REPLIES 8
Corthouts Carlo
Valued Contributor

Re: Ulimit

Hi,

When setting ulimit you have to take in account that the value used cannot exceed the value of the kernel parameter of maxssiz.

When you want to increase the value you need to increase the kernel parameter first.

NOTE : changing kernel parameters require a kernel rebuild and reboot.
Steve Steel
Honored Contributor

Re: Ulimit

Hi

Please remeber the following.

The minimum, maximum, and default ulimit values are based on certain
kernel parameters.

For the Korn shell (ksh), ulimit only affects the filesize limit
which defaults to 4194304, and this is the ksh value for unlimited.

For the POSIX shell (sh), there are several variables that can be set
with ulimit. The 'ulimit -a' command lists the variables that can be
set for the posix shell.

Note: See the sh-posix(1) man page. There are soft and hard
limits for these variables.

Soft Limit:
-----------

$ ulimit -aS
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 65536 max determined by maxdsiz
stack(kbytes) 8192 max determined by maxssiz
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 60 max determined by maxfiles

Hard Limit:
-----------

$ ulimit -aH
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 65536
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) 1024 max determined by maxfiles_lim



Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
harry d brown jr
Honored Contributor

Re: Ulimit


Corthouts, maxssiz has nothing to do with file size limits.

Steve, the ulimit file size of 4,194,304 is the number of blocks (512 bytes) giving 2,147,483,648 bytes (2gb).

John, because you have a limit of 32mb, you have a profile that is setting this lower limit. Look at /etc/profile or the users local .profiles.

The file size limits are defined in /usr/include/sys/resources.h.

for 64 bit machines the filesize upper limits are huge.

live free or die
harry


Live Free or Die
Corthouts Carlo
Valued Contributor

Re: Ulimit

John,

Could you tell us what version of HP-UX you are using since harry is somehow confused about the question.

For 10.20 systems the limits for ulimit values are determined by kernel parameters.

Sorry Harry but I was not talking about FILE SIZE limits but about ULIMIT.

Even for 10.20 systems the file size limits are determined by kernel parameters.


harry d brown jr
Honored Contributor

Re: Ulimit

Corthouts,

John's question was about changing UL_SETFILESIZE via ulimit, because he had a 32mb limit. The posix "sh" (/usr/bin/sh) allows you to set the file limit via the "-f" option, as in "ulimit -f 50000". Of course only root can increase a processes file limit.

What kernel parameter at HPux 10.20 limits the size of a file? The reason I ask this, is because the /usr/include/sys/resouces.h defines RLIM_INFINITY which corresponds to the largest file size that can be created:

10.20:
ulimit()

The default UL_FILESIZE that a process used to get was (2GB - 511)/512. The new default is 2GB/512. This value now corresponds to INFINITY in the kernel. Therefore, the default file size limit for a process is RLIM_INFINITY.

http://wwwinfo.cern.ch/pdp/as/file/hpux10/RN13961020.html



live free or die
harry
Live Free or Die
Corthouts Carlo
Valued Contributor

Re: Ulimit

You are right.

I got confused about the large files option which is set as default on 10.20 systems.

When not creating filesystems with the option large_files you run into the 2GB limit.

Sorry my last response was partially wrong.
John Walker_1
Advisor

Re: Ulimit

Corthouts, it is 10.20 version we are using.
I cannot find any reference to a 32Mb filesize anywhere suggested already.

Perhaps this is an application/cobol/proIV issue rather than HPUX.
Once the file hits 32Mb, the application which creates it terminates the relevant process.

I am at a bit of a loss now.
Corthouts Carlo
Valued Contributor

Re: Ulimit

Maybe you should check the /etc/profile and see if maybe ulimit has been set there.

Which Cobol are you using?

I found a reference where ulimit determines the filesize and not cobol but this might be HP specific.

Is there any definition of
ulimit -f xxxxx?

For instance :

ulimit -f 20000 limits cobol filesize to 10Mb.

Maybe you should also check the homedirectory of the user which is used to start the application? does the .profile contain anything in there?