Operating System - HP-UX
1820390 Members
3717 Online
109623 Solutions
New Discussion юеВ

unable to change of nofiles value

 
sahir_1
Frequent Advisor

unable to change of nofiles value

Hi Admin's,

I have HPUX 11.31, would like to change nofiles value to 65536 from 4096. I used some steps used to change it, but none of that works. I use ulimit -a for verification of my change.Steps are given below:

1. ulimit -Hn 65536
2. ulimit -Sn 65536
3. Added ulimit -n 65536 in /etc/profile.

All this I performed as root.

# ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 3145728
stack(kbytes) 65536
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 4096

Is any changes I need to make in maxfiles or maxfiles_lim parameter to get it worked. Current values are given below:

# kctune -q maxfiles maxfiles_lim
Tunable Value Expression Changes
maxfiles 4096 4096
maxfiles_lim 65536 65536 Immed


Please help me. I appreciate any reply

Thanks,
Sahir
6 REPLIES 6
Stephan.
Honored Contributor

Re: unable to change of nofiles value

sahir_1
Frequent Advisor

Re: unable to change of nofiles value

Thanks Stephen,

There is no confusion about shell. I did all changes and checking from POSIX shell. /usr/bin/sh.

sahir_1
Frequent Advisor

Re: unable to change of nofiles value

Still nofiles is not getting updated to a new value.. Please guide

Sahir
g3jza
Esteemed Contributor

Re: unable to change of nofiles value

hmm,
what shell exactly are you using?

#echo $SHELL ; POSIX should be /sbin/sh

Are you running it under root?

Maybe you have some local /root/.profile or just /.profile ,depending on your root home dir, where the 'nofiles' gets overwritten?

Stephan.
Honored Contributor

Re: unable to change of nofiles value

Hi again,

step by step:

/root # whoami
root


/root # ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048


/root # kctune -q maxfiles maxfiles_lim
Tunable Value Expression Changes
maxfiles 2048 Default
maxfiles_lim 65536 65536 Immed


/root # echo ulimit -n 65536 >> /etc/profile
/root # tail -n 1 /etc/profile
ulimit -n 65536

/root # ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048


/root #
logout root

login root again
/root # ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 65536

That's it.

hth
Stephan
Dennis Handly
Acclaimed Contributor

Re: unable to change of nofiles value

After you changed maxfiles_lim, any non-root users will have to relogin.

>3. Added ulimit -n 65536 in /etc/profile.

No need to do that, unless you want to make it smaller than maxfiles_lim. And if you ever want to make it bigger, you'll have to remember you put it there.