RE: "Naive question" thread

2002-12-20 Thread Brandon Cruz
I was having a problem with Tomcat creating over 600 threads on startup.  I
have a couple hundred hosts and a couple contexts per host.  This was
causing huge a huge performance problem with CPU usage in tomcat 3.2.4, but
it seems to work OK with tomcat4, even though it still creates as many
threads.  According to the following from Craig, the huge amount of threads
is normal

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

* Request processing threads (configured in your
   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.



Brandon Cruz


-Original Message-
From: Milt Epstein [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 2:16 PM
To: Tomcat Users List
Subject: RE: "Naive question" thread


On Thu, 19 Dec 2002, Denise Mangano wrote:

> Hi all :)
>
> In response, I was running ps -ef to view what was running.  I
> haven't had a chance to read the man on ps, but I did quickly try
> pstree -aup as you suggested.  It looks like (if I am reading the
> tree right) there is only one java process, with a number of threads
> branching off.  The same for the httpd process.
>
> Just out of curiousity, why would so many threads be spawned just
> after starting the services before doing anything?

There are several things those threads could be created for.  First of
all, tomcat is set up to do one request per thread, and it typically
creates a pool of request processing threads to handle requests (you
can control this somewhat because most/all Connector's have
minProcessors and maxProcessors attributes).  So, initially, some
minimum number of such threads are created right away.  There will be
other threads for bookkeeping kinds of things, like perhaps to
invalidate sessions.  I'm not really sure what other things other
threads would be for.  I think someone (Craig McClanahan?) recently
posted about what some of those threads are doing, if you're really
curious, you can look that up in the archives.


> -Original Message-----
> From: jon wingfield
> To: Tomcat Users List
> Sent: 12/19/2002 1:47 PM
> Subject: RE: "Naive question" thread
>
> i use pstree -aup.
> Very useful with multiple java apps running on one server :)
>
> -Original Message-
> From: Milt Epstein [mailto:[EMAIL PROTECTED]]
> Sent: 18 December 2002 20:15
> To: Tomcat Users List
> Subject: "Naive question" thread
>
>
>
> Saw a post in the "naive question" thread earlier today that I wanted
> to respond to, but my quick "delete" finger got to it before I got
> around to it.  This was a thread in which John Turner, Denise Mangano,
> and some others had been participating.
>
> Anyway, Denise posted the output of ps that had a whole bunch of java
> processes listed.  I'd be concerned about the number of such
> processes, because normally there shouldn't be so many -- in fact,
> most typically (i.e. one tomcat instance), there should be just one.
> Now, Denise said she's using linux, and it's my understanding that ps
> under linux will list threads, not just processes.  So it's possible
> all those java listings were all the threads running in one java
> process.  And I think there's an option to ps to cause it list actual
> processes, not threads.  So you might try that and see what the output
> looks like.

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: "Naive question" thread

2002-12-20 Thread Milt Epstein
On Thu, 19 Dec 2002, Denise Mangano wrote:

> Hi all :)
>
> In response, I was running ps -ef to view what was running.  I
> haven't had a chance to read the man on ps, but I did quickly try
> pstree -aup as you suggested.  It looks like (if I am reading the
> tree right) there is only one java process, with a number of threads
> branching off.  The same for the httpd process.
>
> Just out of curiousity, why would so many threads be spawned just
> after starting the services before doing anything?

There are several things those threads could be created for.  First of
all, tomcat is set up to do one request per thread, and it typically
creates a pool of request processing threads to handle requests (you
can control this somewhat because most/all Connector's have
minProcessors and maxProcessors attributes).  So, initially, some
minimum number of such threads are created right away.  There will be
other threads for bookkeeping kinds of things, like perhaps to
invalidate sessions.  I'm not really sure what other things other
threads would be for.  I think someone (Craig McClanahan?) recently
posted about what some of those threads are doing, if you're really
curious, you can look that up in the archives.


> -Original Message-
> From: jon wingfield
> To: Tomcat Users List
> Sent: 12/19/2002 1:47 PM
> Subject: RE: "Naive question" thread
>
> i use pstree -aup.
> Very useful with multiple java apps running on one server :)
>
> -Original Message-
> From: Milt Epstein [mailto:[EMAIL PROTECTED]]
> Sent: 18 December 2002 20:15
> To: Tomcat Users List
> Subject: "Naive question" thread
>
>
>
> Saw a post in the "naive question" thread earlier today that I wanted
> to respond to, but my quick "delete" finger got to it before I got
> around to it.  This was a thread in which John Turner, Denise Mangano,
> and some others had been participating.
>
> Anyway, Denise posted the output of ps that had a whole bunch of java
> processes listed.  I'd be concerned about the number of such
> processes, because normally there shouldn't be so many -- in fact,
> most typically (i.e. one tomcat instance), there should be just one.
> Now, Denise said she's using linux, and it's my understanding that ps
> under linux will list threads, not just processes.  So it's possible
> all those java listings were all the threads running in one java
> process.  And I think there's an option to ps to cause it list actual
> processes, not threads.  So you might try that and see what the output
> looks like.

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: "Naive question" thread

2002-12-19 Thread Jason Pyeron

the number of threads is needed so the server can respond to multiple 
requests at the same time.

the system can only answer one socket per thread a a time.

-Jason Pyeron

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-   -
- Jason Pyeron   http://www.pyerotechnics.com   -
- Owner & Lead  Pyerotechnics Development, Inc. -
- +1 410 808 6646 (c)   500 West University Parkway #1S -
- +1 410 467 2266 (f)   Baltimore, Maryland  21210-3253 -
-   -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.


On Thu, 19 Dec 2002, Denise Mangano wrote:

Hi all :)

In response, I was running ps -ef to view what was running.  I haven't had a
chance to read the man on ps, but I did quickly try pstree -aup as you
suggested.  It looks like (if I am reading the tree right) there is only one
java process, with a number of threads branching off.  The same for the
httpd process.

Just out of curiousity, why would so many threads be spawned just after
starting the services before doing anything?

Thanks :)
Denise

-Original Message-
From: jon wingfield
To: Tomcat Users List
Sent: 12/19/2002 1:47 PM
Subject: RE: "Naive question" thread

i use pstree -aup.
Very useful with multiple java apps running on one server :)

-Original Message-
From: Milt Epstein [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 20:15
To: Tomcat Users List
Subject: "Naive question" thread



Saw a post in the "naive question" thread earlier today that I wanted
to respond to, but my quick "delete" finger got to it before I got
around to it.  This was a thread in which John Turner, Denise Mangano,
and some others had been participating.

Anyway, Denise posted the output of ps that had a whole bunch of java
processes listed.  I'd be concerned about the number of such
processes, because normally there shouldn't be so many -- in fact,
most typically (i.e. one tomcat instance), there should be just one.
Now, Denise said she's using linux, and it's my understanding that ps
under linux will list threads, not just processes.  So it's possible
all those java listings were all the threads running in one java
process.  And I think there's an option to ps to cause it list actual
processes, not threads.  So you might try that and see what the output
looks like.

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: "Naive question" thread

2002-12-19 Thread Denise Mangano
Hi all :)

In response, I was running ps -ef to view what was running.  I haven't had a
chance to read the man on ps, but I did quickly try pstree -aup as you
suggested.  It looks like (if I am reading the tree right) there is only one
java process, with a number of threads branching off.  The same for the
httpd process.

Just out of curiousity, why would so many threads be spawned just after
starting the services before doing anything?

Thanks :)
Denise

-Original Message-
From: jon wingfield
To: Tomcat Users List
Sent: 12/19/2002 1:47 PM
Subject: RE: "Naive question" thread

i use pstree -aup.
Very useful with multiple java apps running on one server :)

-Original Message-
From: Milt Epstein [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 20:15
To: Tomcat Users List
Subject: "Naive question" thread



Saw a post in the "naive question" thread earlier today that I wanted
to respond to, but my quick "delete" finger got to it before I got
around to it.  This was a thread in which John Turner, Denise Mangano,
and some others had been participating.

Anyway, Denise posted the output of ps that had a whole bunch of java
processes listed.  I'd be concerned about the number of such
processes, because normally there shouldn't be so many -- in fact,
most typically (i.e. one tomcat instance), there should be just one.
Now, Denise said she's using linux, and it's my understanding that ps
under linux will list threads, not just processes.  So it's possible
all those java listings were all the threads running in one java
process.  And I think there's an option to ps to cause it list actual
processes, not threads.  So you might try that and see what the output
looks like.

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: "Naive question" thread

2002-12-19 Thread jon wingfield
i use pstree -aup.
Very useful with multiple java apps running on one server :)

-Original Message-
From: Milt Epstein [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 20:15
To: Tomcat Users List
Subject: "Naive question" thread



Saw a post in the "naive question" thread earlier today that I wanted
to respond to, but my quick "delete" finger got to it before I got
around to it.  This was a thread in which John Turner, Denise Mangano,
and some others had been participating.

Anyway, Denise posted the output of ps that had a whole bunch of java
processes listed.  I'd be concerned about the number of such
processes, because normally there shouldn't be so many -- in fact,
most typically (i.e. one tomcat instance), there should be just one.
Now, Denise said she's using linux, and it's my understanding that ps
under linux will list threads, not just processes.  So it's possible
all those java listings were all the threads running in one java
process.  And I think there's an option to ps to cause it list actual
processes, not threads.  So you might try that and see what the output
looks like.

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: