Re: Confusion about Solaris file descriptors limits



In article <kTPFh.234719$IL1.76838@xxxxxxxxxxxx>, ohaya <ohaya@xxxxxxx> wrote:
Hi,

We are running WebLogic (8.1 SP5) on Solaris 9 SPARC, and we are running
into a problem where we think that WebLogic is encountering problems
because of the number of file descriptors. I've been looking into this,
and am confused about file descriptor limits under Solaris...

Here's what "ulimit -a" shows on our systems (as root):

bash-2.05# ulimit -a
core file size (blocks) unlimited
data seg size (kbytes) unlimited
file size (blocks) unlimited
open files 256
pipe size (512 bytes) 10
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes 25813
virtual memory (kbytes) unlimited

The /etc/system doesn't (currently) have anything in it other than comments.

Now, when I do a "plimit <pid>" on the WebLogic process, I get:

bash-2.05# plimit 590
590: /bin/sh ./startWebLogic.sh
resource current maximum
time(seconds) unlimited unlimited
file(blocks) unlimited unlimited
data(kbytes) unlimited unlimited
stack(kbytes) 8192 unlimited
coredump(blocks) unlimited unlimited
nofiles(descriptors) 1024 1024
vmemory(kbytes) unlimited unlimited

At first, I couldn't figure out why the "plimit <pid> was showing
1024,1024, but, in one of the scripts that is called by the WebLogic
startup, there's this:

# limit the number of open file descriptors
resetFd() {
if [ ! -n "`uname -s |grep -i cygwin || uname -s |grep -i windows_nt || \
uname -s |grep -i HP-UX`" ]
then
maxfiles=`ulimit -H -n`
if [ "$?" = "0" -a "${maxfiles}" != 1024 ]; then
if [ `expr ${maxfiles} : '[0-9][0-9]*$'` -eq 0 ]; then
maxfiles=1025
fi
if [ "${maxfiles}" -lt 1024 ]; then
ulimit -n ${maxfiles}
else
ulimit -n 1024
fi
fi
fi
}

So, I think that the reason the "plimit <pid>" is showing 1024,1024 is
that the resetFd() is called during startup.

Question 1:

The thing that I am confused about is that this link:

http://e-docs.bea.com/wls/docs81/perform/HWTuning.html#1119561

recommends setting:

set rlim_fd_cur 8192
set rlim_fd_max 8192

But, if I do the above changes to /etc/system, won't the resetFd still
reset the fd limits for the WebLogic process back to 1024,1024??

someone else may be better qualified to answer, but i'll toss in my
$.02.

ulimit should be for a session. plimit should be for a process.
i'm convinced that a given session should max out at ulimit values.
just because some underlying process wants to use more won't affect
ulimit.

since the underlying process seems to want 1024, why not go ahead and
set the ulimit to something larger. why not 2048?
i've rarely encountered trouble, but i've set this limit very large
before and nothing very interesting happened. my primary reaction
is that you're worrying about it too much. i'd say raise the limit
and see whether there are consequences. (of course, maybe you don't
have the luxury of trying it.)




Question 2:
The other question that I've been trying to answer is why does the
resetFd set the fd limit to 1024?


I've found SOME links, etc. that SEEM to indicate that on Solaris, the
fd limit should NOT be set to greater than 1024, but then I found the
following:

http://albertguo.blogspot.com/2005/09/troubleshooting-too-many-open-files.html

which says to edit the resetFd script.


So, I'm wondering: Was there, or is there, a limit in Solaris that says
that the fd limit should NOT be set to greater than 1024?

Was this (1024), perhaps, a limitation or restriction on Solaris prior
to Solaris 9, and/or is this a limitation/restriction on Solaris 9 also?

Should we/can we safely edit the resetFd per the above link to increase
the "ulimit -n" in Solaris 9?

uhhh. well, my oracle users have a descriptor limit of 64K. and life goes
on reasonably on all four such machines.

but i'd start with ulimit in .profile or .cshrc. if the process wants only
1024 let it limit itself. if it wants even more, oh, well. but take
the ulimit thing to more than 1024.





Question 3:

I guess that, in general, I'm a little confused about the plimit vs.
ulimit. As shown above, ulimit shows 256, and then the resetFd script
sets "ulimit -n 1024". Then, when I do the "plimit <pid>" it displays
1024,1024, i.e., it seems like the "ulimit -n 1024" in the resetFd
script set the *plimit for the WebLogic process*?

What is confusing to me is that I thought that the ulimit and plimit
were distinct from each other, but if that's the case, then how come the
"ulimit -n 1024" seems to be affecting the "plimit <pid>"?


again, i think ulimit is effectively a session "parent" limit which
won't be exceeded by the sum of all child proc usage.

j.



My apologies if this is all a bit confusing, but I know that I myself am
a little confused about all of this, and I hope that some of you Solaris
gurus here can clarify this situation for me.

Thanks in advance,
Jim


--
Jay Scott 512-835-3553 gl@xxxxxxxxxxxxxxxx
Head of Sun Support, Sr. Operating Systems Specialist
Applied Research Labs, Computer Science Div. S224
University of Texas at Austin
.



Relevant Pages

  • Re: Confusion about Solaris file descriptors limits
    ... In the WebLogic startup script, modify the resetFd() FROM: ... ulimit -n 1024 ... I'll try to see if I can find them, but does anyone know if there WAS some limitation in Solaris 7 or 8 that doesn't exist in Solaris 9 with respect to the # of file descriptors? ... At first, I couldn't figure out why the "plimit was showing 1024,1024, but, in one of the scripts that is called by the WebLogic startup, there's this: ...
    (comp.unix.solaris)
  • Confusion about Solaris file descriptors limits
    ... We are running WebLogic on Solaris 9 SPARC, and we are running into a problem where we think that WebLogic is encountering problems because of the number of file descriptors. ... At first, I couldn't figure out why the "plimit was showing 1024,1024, but, in one of the scripts that is called by the WebLogic startup, there's this: ... ulimit -n $ ... So, I think that the reason the "plimit " is showing 1024,1024 is that the resetFd() is called during startup. ...
    (comp.unix.solaris)
  • Stupid bash question
    ... How would bash interpret this line? ... Would that be teh same as: ... ulimit -S -n 65536 ... This is quite confusing to me. ...
    (Fedora)
  • Re: File Descriptors on Solaris 2.8
    ... man setrlimit ... man ulimit ... >I was fairly sure that Solaris 2.8 allowed an ulimited number of FD's ... > have this limit set to 1024 however I would like to know if its ...
    (comp.unix.solaris)
  • Re: "java.io.IOException: Too many open files" rlim_fd_cur set to max
    ... > running some program on a Solaris 8. ... > ulimit to max. ... How can I avoid this problem? ... Rhino ...
    (comp.lang.java.programmer)