Operating System - HP-UX
1826451 Members
3989 Online
109692 Solutions
New Discussion

can not increase maxfiles and makfiles_lim

 
SOLVED
Go to solution
Mustafa Gulercan
Respected Contributor

can not increase maxfiles and makfiles_lim

hi;
i have to solve this problem urgently.Pls reply asap.

#sysdef | egrep "NAME|nfile|maxfiles*"
NAME VALUE BOOT MIN-MAX
maxfiles 4096 - 30-2048
maxfiles_lim 4096 - 30-2048
nfile 65546 - 14-

i would like to incerase the MAX to 4096.

i try to change like as following;
#kmtune -s maxfiles=4096
#config -u /stand/system
after rebooting there is nothing to change.

mustafa
20 REPLIES 20
Warren_9
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

hi,

the max value of the maxfiles and maxfile_lim is 2048... it show in the sysdef output.

GOOD LUCK.
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

yes ,and i want to increase tha MAX value 2048 to 4096.But how?

thanks..
RAC_1
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

Was kernel built successful?
What does following say?
echo "mod_initialized/D" | adb -k /stand/vmunix /dev/kmem
There is no substitute to HARDWORK
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

yes ,it was successful.

# echo "mod_initialized/D" | adb -k /stand/vmunix /dev/kmem
mod_initialized:
mod_initialized: 1
RAC_1
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

Why not follow these steps?

# cd /stand/build
# /usr/lbin/sysadm/system_prep -v -s system
# /usr/sbin/kmtune -s maxfiles=xxx -S /stand/build/system
# /usr/sbin/mk_kernel -s ./system
# mv /stand/system /stand/system.prev
# mv /stand/vmunix /stand/vmunix.prev
# /usr/sbin/kmupdate

# shutdown -r -y 0
There is no substitute to HARDWORK
Warren_9
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

hi,

the maxfiles is a static parameter, did you try to change in sam and rebuild the kernel and reboot??

RAC_1
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

Did you do reboot or shutdown -ry?

Reboot will cause such problems. it has to be a shutdown -ry.
There is no substitute to HARDWORK
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

hi RAC;

i did all the steps but the MAX value is still 2048

# sysdef | egrep "NAME|ninode|nfile|maxfiles*"
NAME VALUE BOOT MIN-MAX
maxfiles 4096 - 30-2048
maxfiles_lim 4096 - 30-2048
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

i shut the system down.not rebooted.

should i install the PHNE_27217 patch?


Warren_9
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

Hi,

?? from your output, the value is already 4096.

in 11.0 or later the range is 30-60000, it specify in the /usr/conf/master.d/core-hpux.

GOOD LUCK!
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

yes the maxfiles and maxfiles_lim are equal to 4096. but it is not allowed to use 4096

MAX value is 2048.

thanks..
RAC_1
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

echo "maxfiles/D" | adb -k /stand/vmunix /dev/kmem

echo "maxfiles_lim/D" | adb -k /stand/vmunix /dev/kmem
There is no substitute to HARDWORK
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

the output
echo "maxfiles_lim/D" | adb -k /stand/vmunix /dev/kmem ;

for maxfiles and maxfiles_lim are both: 4096

but the output of sysdef;


#sysdef | egrep "NAME|nfile|maxfiles*"
NAME VALUE BOOT MIN-MAX
maxfiles 4096 - 30-2048
maxfiles_lim 4096 - 30-2048
nfile 65546 - 14-
RAC_1
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

do only sysdef and check it out yourself.
There is no substitute to HARDWORK
Senthil Kumar .A_1
Honored Contributor
Solution

Re: can not increase maxfiles and makfiles_lim

Hi Mustafa,

The field "MIN-MAX" is just a informational field that says minimum value that can be configured is 32 and default max is 2048. Actually you output suggests that you maxfiles and maxfiles_max is actually configured to 4096. You can't modify the "MIN-MAX" field values as I said it is just informational and has no bearing with the actual operation.

The user has a limitation to configure maxfiles upto - 1048576. Also if you consult the man page of maxfiles there is another condition to this which I have pasted below..

QOUTE:

The minimum value is 32. The maximum value is 1048576, or 1M. The
value is further constrained in that it must be equal to or less than
the hard limit, maxfiles_lim.


END QUOTE

If you want to increase maxfiles further first make sure you increase maxfiles_lim first and then later maxfiles.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

#sysdef

and i checked by myself.it is;
NAME VALUE BOOT MIN-MAX UNITS FLAGS
maxfiles 4096 - 30-2048 -
Senthil Kumar .A_1
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

Hi, in my previous post take the minimum value as 30 in stead of 32 ...
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Mustafa Gulercan
Respected Contributor

Re: can not increase maxfiles and makfiles_lim

hi Kumar;
it is already 30.but could you pls explain what is the advantages ?
Senthil Kumar .A_1
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

Hi Mustafa,

MIN-MAX : 30 - 2048 Just means minimum and maximum value you can set the maxfiles value to. But unfortunately sysdef command does not reflect the new max value which is 1048576. Hence it is always suggested to query the values using "kmtune" instead of sysdef, because it does not show the correct max and min values. Anyway MIN-MAX has no signification for running kernel. Only the VALUE field has the significance. In your case it shows that is is already configured to "4096". I don't see there is any reason to increase this value, unless there is some application that requires to open more than 4096 file descriptor at a time. Better you analyzed the value using the command "kcusage" to see whether the limits are reached and then decide to increase.

command is

kcusage -m maxfiles_lim

The above output will be usage for month.
If it is hardly any percentage..in my case it does not cross more than 4% of configured value. So I leave it safe with my current configured value, in my case it is 4096 aswell.
Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Bill Hassell
Honored Contributor

Re: can not increase maxfiles and makfiles_lim

maxfiles and maxfiles_lim are fences or barriers to prevent bad programs from using too many files. Normally, you would set maxfiles_lim to slightly larger than needed by the program that opens the most files at the same time. Opening hundreds of files is unusual, opening thousands of files (at the same time) is insane but some programmers use files as a poor database. maxfiles_lim is the system-wide limit.

Now maxfiles is normally set to a reasonable value, perhaps 200 or maybe 500. That's because most programs open just a few files at the same time. But maxfiles is a soft limit -- it can be changed inside the program with setrlimit, and any programmer that writes code opening thousands of files should have done this already. If not, it is simply a bad program design.

Now if you are stuck with a bad program and no programmer to fix the problem, you can still leave maxfiles at a sane value and adjust the limit before starting the program with ulimit -n.

NOTE: Many application packages tell you to set maxfiles=maxfiles_lim=4096 (or some other large value. This is simply a bad recommendation that bypasses the very reason that there are two limits. And in many cases, the application never has a need to open more than a few hundred files at the same time.


Bill Hassell, sysadmin