You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Troy J. Kelley" <tk...@e-gineering.com> on 2003/01/07 21:07:03 UTC

Tomcat 4.x and Java Processes

I've been looking all over for the answer to this and can't seem to find
a good answer.

My basic question is that when I start up a *very* basic tomcat config
(JMX Support, HTTP Listener, one engine, one host, once context) I get
several java processes that look the same:


root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
/usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath
/usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
-Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
-Djava.io.tmpdir=/var/tomcat4/temp org.apache.catalina.startup.Bootstrap
start

So, why are there so many processes?  I set minProcessors="1"
maxProcessors="1" for the Coyote HTTP connector to reduce the number of
JVMs related to this...

In the WebSphere world a JVM is synonymous with an "Application Server",
which services the requests for the modules (WAR/EAR) "installed" into
the appserver.

Any insight would be greatly appreciated.

-Troy
tkelley@e-gineering.com


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


Re: Tomcat 4.x and Java Processes

Posted by Wagner José Queiroz de Santana <wa...@timnordeste.com.br>.
    Dear friends,

    I think its valuable to mention that when you use green threads you'll loose
the
benefits of SMP processing, I mean, your threads will run in a single processor
even
if your machine has more than one.

"Troy J. Kelley" wrote:

> Yes, sorry, I forgot to mention that.  Are there options for threading
> on linux?  I think on Solaris, you can do "green" or native threads.  If
> so, would a change in this setting reduce the JVM to a single pid?
>
> Thanks for the quick reply!
>
> -Troy
>
> -----Original Message-----
> From: Ben Ricker [mailto:bricker@wellinx.com]
> Sent: Tuesday, January 07, 2003 3:13 PM
> To: Tomcat Users List
> Subject: Re: Tomcat 4.x and Java Processes
>
> Are you using Linux? Linux shows in-process threads as processes. If you
> are running Linux, then you are seeing threads within the Java process.
> You would expect to see a number of threads even with your simple
> config.
>
> Ben Ricker
>
> On Tue, 2003-01-07 at 14:07, Troy J. Kelley wrote:
> > I've been looking all over for the answer to this and can't seem to
> find
> > a good answer.
> >
> > My basic question is that when I start up a *very* basic tomcat config
> > (JMX Support, HTTP Listener, one engine, one host, once context) I get
> > several java processes that look the same:
> >
> >
> > root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
> > /usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath
> > /usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
> > -Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
> > -Djava.io.tmpdir=/var/tomcat4/temp
> org.apache.catalina.startup.Bootstrap
> > start
> >
> > So, why are there so many processes?  I set minProcessors="1"
> > maxProcessors="1" for the Coyote HTTP connector to reduce the number
> of
> > JVMs related to this...
> >
> > In the WebSphere world a JVM is synonymous with an "Application
> Server",
> > which services the requests for the modules (WAR/EAR) "installed" into
> > the appserver.
> >
> > Any insight would be greatly appreciated.
> >
> > -Troy
> > tkelley@e-gineering.com
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> --
> Ben Ricker <br...@wellinx.com>
> Wellinx.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>

--
Wagner Santana
Analista de Sistemas - TIM
Av. Conde da Boa Vista, 800
081 3216-2713    081 99136661




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


RE: Tomcat 4.x and Java Processes

Posted by "Troy J. Kelley" <tk...@e-gineering.com>.
Thanks.  Nope, doesn't really bother me at all just trying to learn a
bit more is all.  The thing that got me thinking about this in the first
place is that on an older version of Tomcat (4.1.12?) the init.d script
for stopping tomcat supplied with the RPM wasn't killing off all of the
processes...   I'll move on now - thanks Ben.

-Troy



-----Original Message-----
From: Ben Ricker [mailto:bricker@wellinx.com] 
Sent: Tuesday, January 07, 2003 3:31 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.x and Java Processes

On Tue, 2003-01-07 at 14:21, Troy J. Kelley wrote:
> Yes, sorry, I forgot to mention that.  Are there options for threading
> on linux?  I think on Solaris, you can do "green" or native threads.
If
> so, would a change in this setting reduce the JVM to a single pid?
> 
> Thanks for the quick reply!
> 
> -Troy

Nope. An application like Tomcat, or the JVM for that matter, will
always be multi-threaded. Green or Native has to do with how exactly the
threads are created (I forgot the exact differences).

What is the big deal with seeing multiple Java processes? Are you
worried about RAM? Note that the threads all have the same memory
allocation. You do not add those up; the shared memory is just that:
shared amongst all of the threads.

I would just forget about it and move on. You will not get a single PID.
Well, I tale that back. Never say never when it comes to Unix; you might
be able to list the Parent PIDS only by messing with the 'ps' options. I
have never done that myself, so I suggest, if you feel the need, to look
through the man pages for 'ps'.

HTH,

Ben Ricker

> -----Original Message-----
> From: Ben Ricker [mailto:bricker@wellinx.com] 
> Sent: Tuesday, January 07, 2003 3:13 PM
> To: Tomcat Users List
> Subject: Re: Tomcat 4.x and Java Processes
> 
> Are you using Linux? Linux shows in-process threads as processes. If
you
> are running Linux, then you are seeing threads within the Java
process.
> You would expect to see a number of threads even with your simple
> config.
> 
> Ben Ricker
> 
> On Tue, 2003-01-07 at 14:07, Troy J. Kelley wrote:
> > I've been looking all over for the answer to this and can't seem to
> find
> > a good answer.
> > 
> > My basic question is that when I start up a *very* basic tomcat
config
> > (JMX Support, HTTP Listener, one engine, one host, once context) I
get
> > several java processes that look the same:
> > 
> > 
> > root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
> > /usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath
> > /usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
> > -Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
> > -Djava.io.tmpdir=/var/tomcat4/temp
> org.apache.catalina.startup.Bootstrap
> > start
> > 
> > So, why are there so many processes?  I set minProcessors="1"
> > maxProcessors="1" for the Coyote HTTP connector to reduce the number
> of
> > JVMs related to this...
> > 
> > In the WebSphere world a JVM is synonymous with an "Application
> Server",
> > which services the requests for the modules (WAR/EAR) "installed"
into
> > the appserver.
> > 
> > Any insight would be greatly appreciated.
> > 
> > -Troy
> > tkelley@e-gineering.com
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.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: Tomcat 4.x and Java Processes

Posted by Ben Ricker <br...@wellinx.com>.
On Tue, 2003-01-07 at 14:21, Troy J. Kelley wrote:
> Yes, sorry, I forgot to mention that.  Are there options for threading
> on linux?  I think on Solaris, you can do "green" or native threads.  If
> so, would a change in this setting reduce the JVM to a single pid?
> 
> Thanks for the quick reply!
> 
> -Troy

Nope. An application like Tomcat, or the JVM for that matter, will
always be multi-threaded. Green or Native has to do with how exactly the
threads are created (I forgot the exact differences).

What is the big deal with seeing multiple Java processes? Are you
worried about RAM? Note that the threads all have the same memory
allocation. You do not add those up; the shared memory is just that:
shared amongst all of the threads.

I would just forget about it and move on. You will not get a single PID.
Well, I tale that back. Never say never when it comes to Unix; you might
be able to list the Parent PIDS only by messing with the 'ps' options. I
have never done that myself, so I suggest, if you feel the need, to look
through the man pages for 'ps'.

HTH,

Ben Ricker

> -----Original Message-----
> From: Ben Ricker [mailto:bricker@wellinx.com] 
> Sent: Tuesday, January 07, 2003 3:13 PM
> To: Tomcat Users List
> Subject: Re: Tomcat 4.x and Java Processes
> 
> Are you using Linux? Linux shows in-process threads as processes. If you
> are running Linux, then you are seeing threads within the Java process.
> You would expect to see a number of threads even with your simple
> config.
> 
> Ben Ricker
> 
> On Tue, 2003-01-07 at 14:07, Troy J. Kelley wrote:
> > I've been looking all over for the answer to this and can't seem to
> find
> > a good answer.
> > 
> > My basic question is that when I start up a *very* basic tomcat config
> > (JMX Support, HTTP Listener, one engine, one host, once context) I get
> > several java processes that look the same:
> > 
> > 
> > root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
> > /usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath
> > /usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
> > -Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
> > -Djava.io.tmpdir=/var/tomcat4/temp
> org.apache.catalina.startup.Bootstrap
> > start
> > 
> > So, why are there so many processes?  I set minProcessors="1"
> > maxProcessors="1" for the Coyote HTTP connector to reduce the number
> of
> > JVMs related to this...
> > 
> > In the WebSphere world a JVM is synonymous with an "Application
> Server",
> > which services the requests for the modules (WAR/EAR) "installed" into
> > the appserver.
> > 
> > Any insight would be greatly appreciated.
> > 
> > -Troy
> > tkelley@e-gineering.com
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.com


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


RE: Tomcat 4.x and Java Processes

Posted by Mike Millson <mg...@atsga.com>.
On Linux "ps -fx" will not show the tomcat processes if tomcat is run under
a different account. I think "ps -fx" just shows processes running under
root??? To see all processes, I had to do "ps -fxa" to see my tomcat
processes running under the tomcat4 account.

Mike

-----Original Message-----
From: Rob A. Augustinus [mailto:devious@siulintao.net]
Sent: Tuesday, January 07, 2003 3:34 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.x and Java Processes



Not sure if someone mentioned this but you cat try "ps fx"
To see which process is the parent and which are the childs..

Rob

-----Original Message-----
From: Troy J. Kelley [mailto:tkelley@e-gineering.com]
Sent: Tuesday, January 07, 2003 12:21
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.x and Java Processes


Yes, sorry, I forgot to mention that.  Are there options for threading
on linux?  I think on Solaris, you can do "green" or native threads.  If
so, would a change in this setting reduce the JVM to a single pid?

Thanks for the quick reply!

-Troy

-----Original Message-----
From: Ben Ricker [mailto:bricker@wellinx.com]
Sent: Tuesday, January 07, 2003 3:13 PM
To: Tomcat Users List
Subject: Re: Tomcat 4.x and Java Processes

Are you using Linux? Linux shows in-process threads as processes. If you
are running Linux, then you are seeing threads within the Java process.
You would expect to see a number of threads even with your simple
config.

Ben Ricker

On Tue, 2003-01-07 at 14:07, Troy J. Kelley wrote:
> I've been looking all over for the answer to this and can't seem to
find
> a good answer.
>
> My basic question is that when I start up a *very* basic tomcat config

> (JMX Support, HTTP Listener, one engine, one host, once context) I get

> several java processes that look the same:
>
>
> root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
> /usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath
> /usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
> -Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
> -Djava.io.tmpdir=/var/tomcat4/temp
org.apache.catalina.startup.Bootstrap
> start
>
> So, why are there so many processes?  I set minProcessors="1"
> maxProcessors="1" for the Coyote HTTP connector to reduce the number
of
> JVMs related to this...
>
> In the WebSphere world a JVM is synonymous with an "Application
Server",
> which services the requests for the modules (WAR/EAR) "installed" into

> the appserver.
>
> Any insight would be greatly appreciated.
>
> -Troy
> tkelley@e-gineering.com
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
Ben Ricker <br...@wellinx.com>
Wellinx.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>


--
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: Tomcat 4.x and Java Processes

Posted by "Rob A. Augustinus" <de...@siulintao.net>.
Not sure if someone mentioned this but you cat try "ps fx" 
To see which process is the parent and which are the childs..

Rob

-----Original Message-----
From: Troy J. Kelley [mailto:tkelley@e-gineering.com] 
Sent: Tuesday, January 07, 2003 12:21
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.x and Java Processes


Yes, sorry, I forgot to mention that.  Are there options for threading
on linux?  I think on Solaris, you can do "green" or native threads.  If
so, would a change in this setting reduce the JVM to a single pid?

Thanks for the quick reply!

-Troy

-----Original Message-----
From: Ben Ricker [mailto:bricker@wellinx.com] 
Sent: Tuesday, January 07, 2003 3:13 PM
To: Tomcat Users List
Subject: Re: Tomcat 4.x and Java Processes

Are you using Linux? Linux shows in-process threads as processes. If you
are running Linux, then you are seeing threads within the Java process.
You would expect to see a number of threads even with your simple
config.

Ben Ricker

On Tue, 2003-01-07 at 14:07, Troy J. Kelley wrote:
> I've been looking all over for the answer to this and can't seem to
find
> a good answer.
> 
> My basic question is that when I start up a *very* basic tomcat config

> (JMX Support, HTTP Listener, one engine, one host, once context) I get

> several java processes that look the same:
> 
> 
> root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
> /usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath 
> /usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
> -Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4 
> -Djava.io.tmpdir=/var/tomcat4/temp
org.apache.catalina.startup.Bootstrap
> start
> 
> So, why are there so many processes?  I set minProcessors="1" 
> maxProcessors="1" for the Coyote HTTP connector to reduce the number
of
> JVMs related to this...
> 
> In the WebSphere world a JVM is synonymous with an "Application
Server",
> which services the requests for the modules (WAR/EAR) "installed" into

> the appserver.
> 
> Any insight would be greatly appreciated.
> 
> -Troy
> tkelley@e-gineering.com
> 
> 
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.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>


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


RE: Tomcat 4.x and Java Processes

Posted by "Troy J. Kelley" <tk...@e-gineering.com>.
Yes, sorry, I forgot to mention that.  Are there options for threading
on linux?  I think on Solaris, you can do "green" or native threads.  If
so, would a change in this setting reduce the JVM to a single pid?

Thanks for the quick reply!

-Troy

-----Original Message-----
From: Ben Ricker [mailto:bricker@wellinx.com] 
Sent: Tuesday, January 07, 2003 3:13 PM
To: Tomcat Users List
Subject: Re: Tomcat 4.x and Java Processes

Are you using Linux? Linux shows in-process threads as processes. If you
are running Linux, then you are seeing threads within the Java process.
You would expect to see a number of threads even with your simple
config.

Ben Ricker

On Tue, 2003-01-07 at 14:07, Troy J. Kelley wrote:
> I've been looking all over for the answer to this and can't seem to
find
> a good answer.
> 
> My basic question is that when I start up a *very* basic tomcat config
> (JMX Support, HTTP Listener, one engine, one host, once context) I get
> several java processes that look the same:
> 
> 
> root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
> /usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath
> /usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
> -Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
> -Djava.io.tmpdir=/var/tomcat4/temp
org.apache.catalina.startup.Bootstrap
> start
> 
> So, why are there so many processes?  I set minProcessors="1"
> maxProcessors="1" for the Coyote HTTP connector to reduce the number
of
> JVMs related to this...
> 
> In the WebSphere world a JVM is synonymous with an "Application
Server",
> which services the requests for the modules (WAR/EAR) "installed" into
> the appserver.
> 
> Any insight would be greatly appreciated.
> 
> -Troy
> tkelley@e-gineering.com
> 
> 
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.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: Tomcat 4.x and Java Processes

Posted by Ben Ricker <br...@wellinx.com>.
Are you using Linux? Linux shows in-process threads as processes. If you
are running Linux, then you are seeing threads within the Java process.
You would expect to see a number of threads even with your simple
config.

Ben Ricker

On Tue, 2003-01-07 at 14:07, Troy J. Kelley wrote:
> I've been looking all over for the answer to this and can't seem to find
> a good answer.
> 
> My basic question is that when I start up a *very* basic tomcat config
> (JMX Support, HTTP Listener, one engine, one host, once context) I get
> several java processes that look the same:
> 
> 
> root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02
> /usr/java/jdk/bin/java -Djava.endorsed.dirs= -classpath
> /usr/java/jdk/lib/tools.jar:/var/tomcat4/bin/bootstrap.jar
> -Dcatalina.base=/var/tomcat4 -Dcatalina.home=/var/tomcat4
> -Djava.io.tmpdir=/var/tomcat4/temp org.apache.catalina.startup.Bootstrap
> start
> 
> So, why are there so many processes?  I set minProcessors="1"
> maxProcessors="1" for the Coyote HTTP connector to reduce the number of
> JVMs related to this...
> 
> In the WebSphere world a JVM is synonymous with an "Application Server",
> which services the requests for the modules (WAR/EAR) "installed" into
> the appserver.
> 
> Any insight would be greatly appreciated.
> 
> -Troy
> tkelley@e-gineering.com
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
Ben Ricker <br...@wellinx.com>
Wellinx.com


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


Re: Tomcat 4.x and Java Processes

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

On Tue, 7 Jan 2003, Troy J. Kelley wrote:

> Date: Tue, 7 Jan 2003 15:07:03 -0500
> From: Troy J. Kelley <tk...@e-gineering.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat 4.x and Java Processes
>
> I've been looking all over for the answer to this and can't seem to find
> a good answer.
>
> My basic question is that when I start up a *very* basic tomcat config
> (JMX Support, HTTP Listener, one engine, one host, once context) I get
> several java processes that look the same:
>
>
> root      5865  0.0  5.7 227380 29548 ?      S    15:02   0:02

They are not processes, they are threads.  The "ps" on Linux lies to you.

Craig


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