tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Limiting the number of live processes
Date Fri, 22 Sep 2000 17:52:37 GMT
Gary Lawrence Murphy wrote:

> >>>>> "C" == Craig R McClanahan <> writes:
>     C> Gary Lawrence Murphy wrote:
>     >> My idle Tomcat server is generating 35 processes (no clients);
>     >> this is on a test machine where I really only need about a
>     >> tenth that many.  Can I limit the number of live processes?
>     >>
>     C> Is this on a Linux box?  Native threads JDK?  If so, those are
>     C> really threads, not processes -- there is only one "real"
>     C> process, and "ps" output is *really* misleading.
> As soon as I posted, I realized that I should have said so, and the
> answers are yes, probably and probably yes.  Linux & IBM JDK 1.3.
> So now I have just a trivia question: Why so many threads on an idle
> system?

Threads are generally created by the following components:

* The connector pool precreates threads so that, as simultaneous
  requests come in, they will already exist.  Then, these threads are
  recycled rather than being created and destroyed all the time.  The
  pool can be configured through property settings for how many it

* Background threads for things like checking classfile changes for
  autoreload, session invalidation, etc.

* Depending on its implementation, the JVM might itself have background
  threads running for garbage collection or other reasons.

Most of the time, the threads that Tomcat creates are blocked waiting for
input (or waiting for a timer to expire), so they don't occupy any CPU time
(or any memory, other than the runtime stack that is allocated for each
thread).  So, it's no big deal to have the threads active but idle.  In
fact, it improves performance to have them this way, rather than created on
the fly for every request.

> Gary Lawrence Murphy <> TeleDynamics Communications Inc
> Business Innovations Through Open Source Systems:
> "Computers are useless.  They can only give you answers."(Pablo Picasso)


See you at ApacheCon Europe <>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

View raw message