Operating System - HP-UX
1832308 Members
2677 Online
110041 Solutions
New Discussion

Soft limit and hard limit

 
rana786
Regular Advisor

Soft limit and hard limit

Hi All,

Can any body explain me following issues?

1. Kernel parameter maxfile and maxfile_lim refer as a soft limit and hard limit. What is the difference between soft limit and hard limit?

2. How much memory should be free for a smooth operation of a mission critical server? I mean memory utilization should not be beyond what percent?

Rgds,
Mostafa
Walker_dhk
4 REPLIES 4
Victor Fridyev
Honored Contributor

Re: Soft limit and hard limit

Hi,

1.Maxfiles specifies the system default soft limit for the number of files a process is allowed to have open at any given time. It is possible for a process to increase its soft limit and therefore open more than maxfiles files.

Non-superuser processes can increase their soft limit until they reach the hard limit ( maxfiles_lim).
Maxfiles_lim is useful only if it does not exceed the limits imposed by nfile and ninode.

2. The more the better. This depends on running applications requirement and needed performance, if the running applications are memory-bounded.

HTH


Entities are not to be multiplied beyond necessity - RTFM
Ninad_1
Honored Contributor

Re: Soft limit and hard limit

Hi,

You may as well read the following thread
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=909129
Bill has ellaborated as below
"maxfiles is simply a starting point, normally set quite low (60 to 120) for ordinary users. Power programs that really need hundreds of files open at the same time will call setrlimit() to change the limit higher. maxfiles_lim is the absolute limit for the number of open files in a single process."

As well you can read this link as well
http://www.faqs.org/faqs/hp/hpux-faq/section-144.html

Regards,
Ninad
Bill Hassell
Honored Contributor

Re: Soft limit and hard limit

Many kernel parameters are limits to prevent bad programs from allocating all the resources. A bad program is one which either runs away due to a defect or does not document the need for an unusual number of open files at the same time. Most programs open less than a dozen files at one time. Even a backup program opens just a few (and then closes them once the data has been written).

Specialized programs might require hundreds of files to be open at the same time. Properly written, these programs will make a system call to setrlimit() to temporarily increase the limit for this one program. If the programmer forgot this system call, you can set the limit higher with ulimit -n.

As far as memory, you want to use all of it most of the time. Occasionally, a program or group of programs may exceed memory but all is well since HP-UX will move idle programs out to the swap area. If this happens too much, you would get more RAM. Most programs require a certain amount of memory which is generally not under your control so maintaining good performance requires enough RAM. Your mission critical system will continue to run even while using swap space.

Note that some older programs may be 32bits in size and will hit memory limits because of limits imposed by 32bits. These issues have been covered several times here in the forums.


Bill Hassell, sysadmin
rana786
Regular Advisor

Re: Soft limit and hard limit

Thanks.
Walker_dhk