tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark H. Wood" <mw...@IUPUI.Edu>
Subject Re: tomcat/java process strangeness
Date Fri, 19 Oct 2007 14:15:12 GMT
On Wed, Oct 17, 2007 at 10:11:36AM -0400, Christopher Schultz wrote:
> > Second strange case:
> > When I start tomcat using /opt/tomcat/bin/catalina.sh start, I get 21
> > processes that running the same command(different PIDs). And my tomcat
> > instance seems to run fine without problem. When I kill one of the
> > process, the rest will go down as well.
> 
> You are seeing each thread as a Linux process. This is perfectly fine
> depending on the kernel version (can't remember which ones do what).
> Linux uses processes to model threads, so it's nothing to worry about.

It's a little more complex than that.

Linux recognizes this overarching abstraction called a Context of
Execution.  Two COEs that have the same virtual address space are what
most people would think of as "threads".  A "process" is the set of
all COEs sharing a given virtual address space.  Apparently the thing
that 'ps' is looking at is actually a table of COEs, not processes.

To make things more fun, different versions of 'ps' work differently.
procps v3 by default coalesces all of a process' threads into a single
line, but 'ps -eLf' will show individual threads.  IIRC procps v2
shows individual threads by default, and I don't recall whether it has
the option of coalescing them.  For still more fun, procps forked
between v2 and v3, so it's possible you are still getting fresh
updates of procps v2.

At one point I had one Tomcat running on Red Hat Linux and another
on Gentoo Linux, and one showed a huge number of Tomcat "processes"
while the other showed only one.  Switching attention between the two
was, uh, interesting.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Typically when a software vendor says that a product is "intuitive" he
means the exact opposite.


Mime
View raw message