tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Kilbride" <j...@kilbride.com>
Subject Re: Tomcat 3.3: ThreadPool bug (IS IT SAFE FOR PRODUCTION USE???)
Date Tue, 01 Jan 2002 22:58:54 GMT
Hi Drasko,

Sorry, I haven't used Solaris in quite a while. I use FreeBSD and Linux most
of the time. I vaguely remember seeing posts about threading issues, but I
can't recall the problems.

I used the 3.2.x release successfully behind Apache before switching to 4.x.
I found that I didn't need Apache, except to serve static content -- no php,
perl, etc...  So, I moved to Tomcat standalone and now I run a faster,
smaller footprint webserver (thttpd) on port 81 to handle my images and
other static content. Unfortunately, you can't load balance this way without
an external solution.

Anyway, I took a look at the 3.3 ThreadPool code and I think the ThreadPool
configuration is actually being done in PoolTCPEndpoint.java in
org.apache.tomcat.util.net. This starts a pool (with the defaults) then uses
the setXXX methods to configure the Pool. When I was using 3.2.x, I remember
there being serious problems if the MAX_THREADS value was ever reached. For
heavy load, the way around it was to set MAX_THREADS equal to the number of
possible Apache child processes (MaxClients in httpd.conf). This way,
MAX_THREADS should never be reached -- hence, no blocking problem. You might
give this a try and see if it helps. It solved the problems I was having
with 3.2.x at the time.

Hope this helps.

Thanks,
--jeff

----- Original Message -----
From: <Drasko.Kokic@viaginterkom.de>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Sunday, December 30, 2001 9:43 PM
Subject: Re: Tomcat 3.3: ThreadPool bug (IS IT SAFE FOR PRODUCTION USE???)


>
>
> Thanks for your reply Jeff :-)
>
> I am using it "behind" the Apache Web server (ajp1.3)  and am having
> serious problems to keep the service alive (not to mention the poor
> performance)
> The Tomcat is increasing the number of threads when under the load and
> inevitable finishes with ThreadPool giving up.
> The code in the ThreadPool is really "not okay" as it does not provide any
> way of tuning the pools and definetly does not provide any solution when
> running out of available Threads :-(
> By the way, do you have any experience with the load-balancing under
ajp1.3
> ... up to now I have observed only that one blocked Tomcat is stalling the
> whole ajp1.3 load-balancing for the rest of the gang (I have 4 Solaris
> machine each configured with identical application).
> Also browsing a bit thrue the internet I have found quite a few articles
> about Solaris and Threads in JVM ... mostly confusing me if not giving me
> very bad feeling in stomach ... any comments about the stability of the
> Tomcat3.3/JDK1.3.1_02/Solaris8 ???
>
> Thanks in advance
> Drasko
>
>
>
>
>
>
> "Jeff Kilbride" <jeff@kilbride.com> on 31.12.2001 06:34:42
>
> Please respond to "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>
> To:   "Tomcat Users List" <tomcat-user@jakarta.apache.org>
> cc:
>
> Subject:  Re: Tomcat 3.3: ThreadPool bug (IS IT SAFE FOR PRODUCTION
USE???)
>
> Are you using Tomcat standalone or with Apache? If standalone, then yes, I
> would recommend using the latest version of Tomcat 4.x. If you're using
> Apache, I would stick with 3.3 until the mod_jk code is fully implemented
> with the 4.x versions.
>
> Thanks,
> --jeff
>
> ----- Original Message -----
> From: <Drasko.Kokic@viaginterkom.de>
> To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
> Sent: Saturday, December 29, 2001 2:09 PM
> Subject: Tomcat 3.3: ThreadPool bug (IS IT SAFE FOR PRODUCTION USE???)
>
>
> >
> >
> > Hi there,
> >
> > I am trying to deploy our production service on the Tomcat 3.3 platform
> > (Solaris8, JDK 1.3.1) but am very often facing the instability problems.
> > Somehow, the ThreadPool just runs out of steam and blocks Connectors
from
> > receiving any more requests.
> >
> > Looking into the source code, I have noticed some very interesting
> > "constructions" in the ThreadPool class.  Namely, the setters for the
> > maxThreads, maxSpareThreads and minSpareThreads are having very little
> > influence as the start() method is resseting the values to the default
> > constants ?!?!
> >
> >     public ThreadPool() {
> >         maxThreads      = MAX_THREADS;
> >         maxSpareThreads = MAX_SPARE_THREADS;
> >         minSpareThreads = MIN_SPARE_THREADS;
> >         currentThreadCount  = 0;
> >         currentThreadsBusy  = 0;
> >         stopThePool = false;
> >     }
> >
> >     public synchronized void start() {
> >      stopThePool=false;
> >         currentThreadCount  = 0;
> >         currentThreadsBusy  = 0;
> >         maxThreads      = MAX_THREADS;
> >         maxSpareThreads = MAX_SPARE_THREADS;
> >         minSpareThreads = MIN_SPARE_THREADS;
> >
> >         adjustLimits();
> >
> >         openThreads(minSpareThreads);
> >         monitor = new MonitorRunnable(this);
> >     }
> >
> > Also, the situation when there are no more available Threads in the pool
> is being handled in a special way which JUST BLOCKS IN THE INFINITE LOOP :
> > -(((
> >
> > Is the code of the Tomcat4 equaly immature or there is a fair chance to
> > role a productiv system on top of it?
> >
> > Thanks in advance for any comments
> >
> > Drasko Kokic
> >
> >
> >
> > --
> > To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> > Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>
>
>
>
>
>
>
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message