Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Apache JServ 1.0 : (Category) Configuration :
Too many open files (on Solaris)
----------
From: Bernie Bernstein bernard@corp.talkcity.com
To: "Java Apache Users" java-apache-users@list.working-dogs.com
Subject: Re: "Too many open files" -- apache 1.3.6, jserv 10b5, solaris
Date: Wed, Jun 9, 1999, 11:30 PM

>After searching the web, and finding
>   (http://www.cloudscape.com/support/pubfaq.html#a58)
>the suggestion  that 'ulimits' on open files of 64 might be too
>low -- and discovering that is indeed the default limit in solaris --
>I tried 'ulimits -n 1024' in the shell from which I
>start apache, but that didn't help.  And I suspect that the
>value of 1024 did not get passed along to jserv.
>

I am also using Solaris and set the ulimit in the /etc/system file. I don't
know where the documentation came from, but my co-worker figured it out and
added these lines to the bottom of the /etc/system file:

set rlim_fd_max=4096
set rlim_fd_cur=1024


Bernie Bernstein
Talk City Inc.
voice: 408-871-5320                   Join the Conversation.
email: bernard@corp.talkcity.com      http://www.talkcity.com/
different shells have different ways of setting the file descriptor limit.
use ulimit -a to see the number of file descriptors available:

prompt# ulimit -a
time(seconds)        unlimited
file(blocks)         unlimited
data(kbytes)         2097148
stack(kbytes)        8192
coredump(blocks)     unlimited
nofiles(descriptors) 64
vmemory(kbytes)      unlimited

in some shells (csh for instance) you need to use the command "limit"
prompt# limit descriptors 512
prompt# ulimit -a
time(seconds)        unlimited
file(blocks)         unlimited
data(kbytes)         2097148
stack(kbytes)        8192
coredump(blocks)     unlimited
nofiles(descriptors) 512
vmemory(kbytes)      unlimited

verifies they've been changed.

Once you've done that in your shell, all subshells 
launched will have the new limit.  If you don't want 
all processes to take up so much file descriptor space,
create a short script that does it for you:
myapachectl:
#!/bin/sh
ulimit -n 512
apachectl $1

Hope this helps
David
use the following script to check the number of filedescriptors of the jserv 
engine

#!/usr/bin/sh

/usr/bin/ps -ea | /usr/bin/grep java | /usr/bin/awk 'BEGIN{} {print $1;} END{}'
| xargs /usr/proc/bin/pfiles | grep rlimit
I could not get the suggested solution of dave to work on Solaris 2.6

Therefore I did the following

1.) Write a shell script called: setfiledesc and put it into the 
    bin directory of apachectl

#!/usr/bin/sh

ulimit -n 1024

2.) put this at the start, right after #!/usr/bin/sh of apachectl

# This sets the filedescriptors to 1024
. ./setfiledesc
#

If you then run the above mentioned script to check the number of filedescriptors 
of the jserv engine you will see that it is set to 1024
[Append to This Answer]
Previous: (Answer) Case sensitivity and Win32
Next: (Answer) Environment Variables
This document is: http://java.apache.org/faq/?file=215
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.