----------
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 |