Hi all!
I have many problems recently with java.io.IOException: Too many open
files on my Tomcat server for /Online Utility/
<http://www.online-utility.org> (http://www.online-utility.org) web site.
The server runs Linux (Suse 9.3). My web server stop running when runs
out of available file descriptors.
I know it is a common problem (at least it is not uncommon), I googled a
lot about that problems and find a lot, but still I have some questions
and issues.
I want to do everything I can to prevent that behavior.
After analyzing "lsof" (see man lsof) I have seen a lot of files open by
WordNetProcessor class I use.
I use WordNetProcessor in many JSP files and it seems if I use it in
static way using
<%! static WordNetProcessor wordNetProcessor=new WordNetProcessor(); %>
it won't lock many files.
*QUESTIONS:*
*** So, could I assume it is favorably to use static objects whenever
possible?
*** Could I also tweak my server.xml somehow to use less threads and
therefore to lock less files?
Currently I have :
<Connector port="80" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
Maybe I should lower to maxThreads="20" minSpareThreads="15"
maxSpareThreads="15"? Or something?
*** Should I check places where I use BufferedReader for something? If
yes, for what?
*** Should I place some System.gc() at few places in code?
*** What else should I do?
BTW, Since I use Virtuozzo powered VPS for its hosting, it seems that
Virtuozzo lower the number of available file descriptors since most
likely they are shared among all virtual private servers.
Thanks in advance for any advice / comment.
--
Mladen Adamovic
http://www.online-utility.org
http://www.cheapvps.info
http://www.vpsreview.com