You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Miguel Angel Tormo <ml...@edicom.eu> on 2007/07/13 21:00:25 UTC

Tomcat thread management like Apache mpm-worker

Hi all,

I have a few questions regarding the process and thread management with 
Tomcat:
Is there a way to achieve some sort of process-threads handling such as that 
of the mpm-worker of Apache http server?
I ask that question because I am using Tomcat 5.5 with JDK 1.4 in Linux 2.6 
and I have only one process running, so it is using only one CPU for all the 
threads. Am I wrong here? If not, is it possible to set up Tomcat to use all 
the CPUs in your computer?

Thanks for your time.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat thread management like Apache mpm-worker

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Miguel Angel Tormo [mailto:mlists@edicom.eu] 
> Subject: Tomcat thread management like Apache mpm-worker
> 
> I ask that question because I am using Tomcat 5.5 with JDK 
> 1.4 in Linux 2.6 and I have only one process running, so it
> is using only one CPU for all the threads. Am I wrong here?

Yes, you are wrong - unless your OS supports some form of thread-CPU
affinity, and you have enabled that.  Each Tomcat thread corresponds to
a native thread, so unless some aspect of the OS is preventing use of
the multiple CPUs, the Tomcat threads will use all resources available,
if needed.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat thread management like Apache mpm-worker

Posted by Juha Laiho <Ju...@iki.fi>.
Miguel Angel Tormo wrote:
> I have a few questions regarding the process and thread management with 
> Tomcat:
> Is there a way to achieve some sort of process-threads handling such as that 
> of the mpm-worker of Apache http server?
> I ask that question because I am using Tomcat 5.5 with JDK 1.4 in Linux 2.6 
> and I have only one process running, so it is using only one CPU for all the 
> threads. Am I wrong here? If not, is it possible to set up Tomcat to use all 
> the CPUs in your computer?

Supplementing the answer already given by Charles;

Supposing that your tomcat process is running as user tomcat, you can use the
following form of "ps" to show per-thread information in Linux command window:
ps -fLu tomcat

Additionally, you can do "kill -QUIT tomcat_process_id" from the command line
to get your Java virtual machine to dump Tomcat thread information into the
log file (it'll show what each of the threads was doing at the time when the
kill command was run -- and this will not stop the tomcat server; all processing
will continue normally).

Data from the above two can be combined, however "ps" shows the thread ids in
decimal numbers (LWP column) whereas the thread dump contains thread ids in
hexadecimal (nid= element), so a conversion is needed to correlate the data.
-- 
..Juha

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org