tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
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 <Craig.McClanahan@eng.sun.com> 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
  creates.

* 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 <garym@teledyn.com> TeleDynamics Communications Inc
> Business Innovations Through Open Source Systems: http://www.teledyn.com
> "Computers are useless.  They can only give you answers."(Pablo Picasso)

Craig

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



Mime
View raw message