Tomcat max processor number reached after long processes .
843841Jun 15 2004 — edited Nov 3 2004Hello all, I have a tomcat 4.1 server that serves clients with servlets. The tomcat server has been integrated with an Apache server on a Sun Saloris machine. I have set the max number of tomcat processor to 50, which, I believe, is sufficient for the traffice of my server. The problem is that the servlets served by the tomcat server have some processes to connect to services that run on other machines, such as email and database. Most of time the servlets run ok, but sometimes the other services on other machine respond very slow or not responding, such as email or database server is down or very slow, then all the processors of tomcat are used by client and the tomcat rejects all new requests.
There may be two solutions: 1. increase max number of tomcat processor, but it is not predicatable. 2. make the long process run in a separate thread, such as the email process.
For the second solution, my question is that if I create a separate thread from the doGet method of a servlet, will the main thread terminate? and will tomcat count one processor has been freed although a new thread spawn from it is still running, for example, the email process is still connecting to the email server to try to send an email?
Is there a better solution for this?
Thanks for your help.