You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ryszard Lach <rl...@debian.org> on 2002/10/03 12:09:22 UTC

Closing Tomcat processors (ajp13 connector)

Hello,

Is there any parameter defining how many idle processors will Tomcat
keep running (Tomcat 4.x)? I have a pretty loaded server, wich from time
to time spawns even more tomcat threads to number defined in
maxProcessor (now it is 400!) and I did not observe closing of them
unless I stop tomcat.

The second problem is  that acceptCount seems not to work. As I
understood acceptCount defines number of connections accepted and queued
until there will be processors available to service them. When I look at
catalina_log and see that there is no more available processors -
an error " No processor available, rejecting this connection" occurs
immediatly, even if acceptCount is set to 200. Am I missing something?

Richard.

-- 
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: how many linux processes should tomcat create???

Posted by Jeremy Joslin <je...@spotlife.com>.
Java threads under Linux show up as individual processes when you do a
top or anything similar.  The number of threads (Linux processes) that
Tomcat creates will of course depend on the application you're
deploying, i.e. if your app starts up a lot of threads for whatever
reason you're going to see those show up as additional processes.  I
don't know the exact number off the top of my head but I would estimate
that Tomcat itself starts < 30 threads, of course this number also
depends on the number of request processors you specify in your
server.xml.  In my experience any app that has 525 threads running needs
to be looked at immediately.  

Having one or more open database connections is okay if you're pooling
the connections in some way.  If the number of physical connections to
your DB is constantly increasing without bound then perhaps you have
another problem to fix.  Using netstat is should be easy to determine
what's going on there.

Jeremy

> -----Original Message-----
> From: David Brown [mailto:dwbrown@webitplanet.com]
> Sent: Thursday, December 05, 2002 9:47 AM
> To: Tomcat Users List
> Subject: Re: how many linux processes should tomcat create???
> 
> Brandon Cruz writes:
> 
> > Does anyone know how many processes tomcat should create?  When I
start
> my
> > server, there are about 525 processes created.  The number
constantly
> grows
> > as time goes on, but I think it is related to a database connection
> being
> > left open.
> >
> > 525 seems like a lot to start with though.
> >
> > Brandon
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:tomcat-user-
> unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:tomcat-user-
> help@jakarta.apache.org>
> >
> 
> Hello Brandon, i case the gurus have not responded i wil put in $0.02.
i
> have been running tc for a few years and have been running on public
> access
> 4 about a year and i monitor (i'm running a linux box) using "top" all
my
> processes, memory, cpu etc. all the time. i have not really kept any
vital
> stats type records, mostly just "eyeball". for whatever it is worth i
ran
> a
> ps -waux on my system and see that i have 45 processes as a result of
> executing catalina.sh (tc server). i have many servlets and jsp
running in
> 4
> different virtual hosts. i cannot expertly confirm of course but 525
> processes would in my estimation a "run-away" condition that needs
> fulltime
> attention until u get this reigned. hope this helps, david.
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how many linux processes should tomcat create???

Posted by David Brown <dw...@webitplanet.com>.
Brandon Cruz writes: 

> Does anyone know how many processes tomcat should create?  When I start my
> server, there are about 525 processes created.  The number constantly grows
> as time goes on, but I think it is related to a database connection being
> left open. 
> 
> 525 seems like a lot to start with though. 
> 
> Brandon 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org> 
> 

Hello Brandon, i case the gurus have not responded i wil put in $0.02. i 
have been running tc for a few years and have been running on public access 
4 about a year and i monitor (i'm running a linux box) using "top" all my 
processes, memory, cpu etc. all the time. i have not really kept any vital 
stats type records, mostly just "eyeball". for whatever it is worth i ran a 
ps -waux on my system and see that i have 45 processes as a result of 
executing catalina.sh (tc server). i have many servlets and jsp running in 4 
different virtual hosts. i cannot expertly confirm of course but 525 
processes would in my estimation a "run-away" condition that needs fulltime 
attention until u get this reigned. hope this helps, david. 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: how many linux processes should tomcat create???

Posted by Brandon Cruz <bc...@norvax.com>.
Could this be due to a large amount of virtual hosts?  We have about 225
virtual hosts cofigured, each with a couple contexts.  Does it create a new
thread for each context and host?



-----Original Message-----
From: Charles Baker [mailto:rascharles@yahoo.com]
Sent: Thursday, December 05, 2002 12:19 PM
To: Tomcat Users List
Subject: Re: how many linux processes should tomcat create???



--- Brandon Cruz <bc...@norvax.com> wrote:
> Does anyone know how many processes tomcat should
> create?  When I start my
> server, there are about 525 processes created.  The
> number constantly grows
> as time goes on, but I think it is related to a
> database connection being
> left open.
>
> 525 seems like a lot to start with though.
>
> Brandon
>

Wow 525! I've got 53 lines listed. I started to say
it's just becuase of the way the kernel deals with
threads...what you're seeing is threads and not heavy
weight processes, but 525 is a whole order of
magnitude more than what i've got going on.

=====
rascharles@yahoo.com
http://www.charleshbaker.com/~chb/
Hacking is a "Good Thing!"
See http://www.tuxedo.org/~esr/faqs/hacker-howto.html

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how many linux processes should tomcat create???

Posted by Charles Baker <ra...@yahoo.com>.
--- Brandon Cruz <bc...@norvax.com> wrote:
> Does anyone know how many processes tomcat should
> create?  When I start my
> server, there are about 525 processes created.  The
> number constantly grows
> as time goes on, but I think it is related to a
> database connection being
> left open.
> 
> 525 seems like a lot to start with though.
> 
> Brandon
> 

Wow 525! I've got 53 lines listed. I started to say
it's just becuase of the way the kernel deals with
threads...what you're seeing is threads and not heavy
weight processes, but 525 is a whole order of
magnitude more than what i've got going on.

=====
rascharles@yahoo.com
http://www.charleshbaker.com/~chb/
Hacking is a "Good Thing!"
See http://www.tuxedo.org/~esr/faqs/hacker-howto.html

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: how many linux processes should tomcat create???

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 6 Dec 2002, Brandon Cruz wrote:

> Date: Fri, 6 Dec 2002 09:28:30 -0600
> From: Brandon Cruz <bc...@norvax.com>
> To: craigmcc@apache.org, Tomcat List <to...@jakarta.apache.org>
> Subject: RE: how many linux processes should tomcat create???
>
> Craig,
>
> I know that actually, just mistyped.  I had talked to you about this
> earlier, but should it be creating that many threads?  The issue is that
> there seems to be a manager thread that monitors all of these and with that
> many threads running, the manager starts taking up a large amount of CPU and
> slows the system down.
>

The threads that Tomcat 4.x creates can be categorized as follows:

* Request processing threads (configured in your
  <Connector> elements) that are shared across
  all virtual hosts and webapps

* Per-host thread that manages live deployments
  (automatically adding new apps dropped into "webapps")
  if liveDeploy="true" -- should not be enabled on a
  production server.

* Per-webapp thread to process reloading on class
  recompilation if reloadable="true" -- should not
  be enabled on a production server.

* Per-webapp thread to process session invalidations.

So, the thread counts you report sound about right for the number of hosts
you report.

It would be technically feasible to process session invalidations for all
webapps in a single thread (or some smaller number of threads allocated
out of a pool), but this has never actually been programmed.  There is
also some element of risk -- webapps can register things that get called
when the session is timed out (HttpSessionBindingListener,
HttpSessionEventListener), so a malicious or broken application could
negatively affect timeouts for other apps running in the same server
unless this were done very carefully.


> Brandon
>

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: how many linux processes should tomcat create???

Posted by Brandon Cruz <bc...@norvax.com>.
Craig,

I know that actually, just mistyped.  I had talked to you about this
earlier, but should it be creating that many threads?  The issue is that
there seems to be a manager thread that monitors all of these and with that
many threads running, the manager starts taking up a large amount of CPU and
slows the system down.

Brandon

-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Thursday, December 05, 2002 8:55 PM
To: Tomcat Users List; bcruz@norvax.com
Subject: Re: how many linux processes should tomcat create???




On Thu, 5 Dec 2002, Brandon Cruz wrote:

> Date: Thu, 5 Dec 2002 12:30:14 -0600
> From: Brandon Cruz <bc...@norvax.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>,
>      bcruz@norvax.com
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: how many linux processes should tomcat create???
>
> Does anyone know how many processes tomcat should create?

One for each time you start Tomcat.

>  When I start my
> server, there are about 525 processes created.  The number constantly
grows
> as time goes on, but I think it is related to a database connection being
> left open.

Those are not processes, those are threads.

>
> 525 seems like a lot to start with though.
>
> Brandon
>

Craig



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how many linux processes should tomcat create???

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 5 Dec 2002, RXZ JLo wrote:

> Date: Thu, 5 Dec 2002 22:12:20 -0800 (PST)
> From: RXZ JLo <ru...@yahoo.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: how many linux processes should tomcat create???
>
> >
> > Those are not processes, those are threads.
> >
>
> $ ps awx shows the output below. As you say the
> following may be threads,

At least on Linux, where the default "ps" display lies to you by implying
that these are processes.

> but how do I get the parent
> process of all these - ie., how do I restrict the
> output to show only the processes and not the threads
> within. I need this to kill the tomcat which keeps
> running even after shutdown(whose cause I dont know)
>
>
>  9046 ?        S      0:04
> /usr/java/jdk1.3.1_06/bin/i386/native_threads/java -D
> java.endorsed.dirs=/home/dev/software/jakarta-tomcat
>  9073 ?        S      0:00
> /usr/java/jdk1.3.1_06/bin/i386/native_threads/java -D
> java.endorsed.dirs=/home/dev/software/jakarta-tomcat
>

I like "ps -auf" or "ps -auxf" for that -- it shows the tree
relationships.

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how many linux processes should tomcat create???

Posted by RXZ JLo <ru...@yahoo.com>.
> 
> Those are not processes, those are threads.
> 

$ ps awx shows the output below. As you say the
following may be threads, but how do I get the parent
process of all these - ie., how do I restrict the
output to show only the processes and not the threads
within. I need this to kill the tomcat which keeps
running even after shutdown(whose cause I dont know)


 9046 ?        S      0:04
/usr/java/jdk1.3.1_06/bin/i386/native_threads/java -D
java.endorsed.dirs=/home/dev/software/jakarta-tomcat
 9073 ?        S      0:00
/usr/java/jdk1.3.1_06/bin/i386/native_threads/java -D
java.endorsed.dirs=/home/dev/software/jakarta-tomcat

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how many linux processes should tomcat create???

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 5 Dec 2002, Brandon Cruz wrote:

> Date: Thu, 5 Dec 2002 12:30:14 -0600
> From: Brandon Cruz <bc...@norvax.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>,
>      bcruz@norvax.com
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: how many linux processes should tomcat create???
>
> Does anyone know how many processes tomcat should create?

One for each time you start Tomcat.

>  When I start my
> server, there are about 525 processes created.  The number constantly grows
> as time goes on, but I think it is related to a database connection being
> left open.

Those are not processes, those are threads.

>
> 525 seems like a lot to start with though.
>
> Brandon
>

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


how many linux processes should tomcat create???

Posted by Brandon Cruz <bc...@norvax.com>.
Does anyone know how many processes tomcat should create?  When I start my
server, there are about 525 processes created.  The number constantly grows
as time goes on, but I think it is related to a database connection being
left open.

525 seems like a lot to start with though.

Brandon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>