You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by paul womack <pw...@papermule.co.uk> on 2010/08/12 13:27:40 UTC

role of the various threads?

I'm trying to do some performance analysis.

In my current test scenario I have a dedicated thread tomcat
that is synchronously performing "some work" in a
hard coded loop.

For the purposes of timing/testing I have ensured
that tomcat is not serving any requests while this
"some work" is going on.

Despite this, a quick run with runhprof
shows that "my" thread is only 	getting a little under 10% of the cycles,
and that tomcat threads called

RMI - TCP Accept-0
RMI - TCP Accept-8333
main
TP-Processor4
http-10722-Processor23
http-10722-Processor24
http-10722-Processor25

are each getting (roughly) as many ticks allocated
as "my" thread.

Any information as to what is going on, wether it's "normal",
where I can look for information on the various threads
and types of thread that tomcat uses would be gratefully accepted.

     BugBear

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


Re: role of the various threads?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul,

On 8/12/2010 11:34 AM, paul womack wrote:
> Caldarale, Charles R wrote:
>>> From: paul womack [mailto:pwomack@papermule.co.uk]
>>> Subject: Re: role of the various threads?
>>>
>>> Further reading has shown me that I'm using Tomcat5.5,
>>> and that the theads (above) are all running accept().
>>>
>>> I thought accept() was blocking?
>>
>> Depends on the particular JRE being used on the particular platform. 
>> I would expect them to be blocking in most instances, but some
>> esoteric systems use polling.  You're getting down to a level that
>> requires examination of not just Tomcat source code, but also JRE
>> source and the platform's TCP/IP stack source - a bit beyond the
>> normal scope of a support forum.
> 
> It appears that hprof is counting blocked threads
> (since that *is* what the program is "doing"
> for some meanings of "doing").
> 
> So the threads are "doing" accept() but not actively
> consuming cycles whilst running accept().
> 
> Sigh. Thanks, hprof.

:)

I think hprof was designed just to sample what the thread is doing
periodically, and if it's always doing the same, you don't really get
any interesting information. Can you tell us what hprof options you've
set, and possibly show us what output you got?

You might want to try hooking up a more fully-featured profiler to your
system and see what it can find.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxkN44ACgkQ9CaO5/Lv0PCGcQCdFCxSdBwVBSQaT1SFWvbhYfRq
JvoAnRW5XFkCY4r8MlX7G+mhc1vaZS9y
=2md4
-----END PGP SIGNATURE-----

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


Re: role of the various threads?

Posted by paul womack <pw...@papermule.co.uk>.
Caldarale, Charles R wrote:
>> From: paul womack [mailto:pwomack@papermule.co.uk]
>> Subject: Re: role of the various threads?
>>
>> Further reading has shown me that I'm using Tomcat5.5,
>> and that the theads (above) are all running accept().
>>
>> I thought accept() was blocking?
> 
> Depends on the particular JRE being used on the particular platform.  I would expect them to be blocking in most instances, but some esoteric systems use polling.  You're getting down to a level that requires examination of not just Tomcat source code, but also JRE source and the platform's TCP/IP stack source - a bit beyond the normal scope of a support forum.

It appears that hprof is counting blocked threads
(since that *is* what the program is "doing"
for some meanings of "doing").

So the threads are "doing" accept() but not actively
consuming cycles whilst running accept().

Sigh. Thanks, hprof.

    BugBear

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


RE: role of the various threads?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: paul womack [mailto:pwomack@papermule.co.uk]
> Subject: Re: role of the various threads?
> 
> Further reading has shown me that I'm using Tomcat5.5,
> and that the theads (above) are all running accept().
> 
> I thought accept() was blocking?

Depends on the particular JRE being used on the particular platform.  I would expect them to be blocking in most instances, but some esoteric systems use polling.  You're getting down to a level that requires examination of not just Tomcat source code, but also JRE source and the platform's TCP/IP stack source - a bit beyond the normal scope of a support forum.

 - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: role of the various threads?

Posted by paul womack <pw...@papermule.co.uk>.
paul womack wrote:
> 
> RMI - TCP Accept-0
> RMI - TCP Accept-8333
> main
> TP-Processor4
> http-10722-Processor23
> http-10722-Processor24
> http-10722-Processor25
> 
> are each getting (roughly) as many ticks allocated
> as "my" thread.

Further reading has shown me that I'm using Tomcat5.5,
and that the theads (above) are all running accept().

I thought accept() was blocking?

   BugBear

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