On Oct 23, 2012, at 12:10 PM, Charles Richard wrote:

> Hi,
> 
> Thanks for the reply!
> 
> The command was the following:
> 
> [root@mysandbox tmp]# netstat -an | grep 8009 | wc
>    856    5136   76184

What output do you get if you remove the "wc" command?


> How should i interpret this?  I thought this meant that 856 threads were
> open while my MaxThreads is 750.

This is not going to accurately give you a count of thread use.  Don't use this 
command for that purpose.  If you want to see thread usage, look at jvisualvm, 
jstack, or jconsole.  All of these will give you accurate counts.


>  I'm trying to understand if all my
> workerThreads are busy (hence trying the jstack dump) and then if they are,
> not sure how I would do this but try to figure out on what they're busy.

To figure out what is going on you have a couple choices:

1.) Use a profiler.  YourKit is a good one, but not free.
2.) Use "top -H" in combination with jstack (or kill -3).  

In most cases a profiler is the best way to go.  The top method is mainly 
useful when something is consistently consuming a large portion of the CPU.

Dan



> My OS is CentOS 5.8 for my sandbox and Red Hat 5.8 for my production boxes.
> 
> Thanks,
> Charles
> 
> On Tue, Oct 23, 2012 at 12:25 PM, Daniel Mikusa <dmik...@vmware.com> wrote:
> 
>>>> Hi,
>>>> 
>>>> I'm testing performance of our Java application in Tomcat (6.0.30) and
>> we
>>>> have maxThreads set to 750.  I noticed that when i did a netstat -an |
>> grep
>>>> my_ajp_port, i saw around 860 connections.
>> 
>> That does not necessarily mean that you have 860 threads running.  What
>> are you trying to determine by running this command?  If you want to see
>> the number of threads, use jconsole, jvisualvm or jstack.
>> 
>> Also, if you include the output of "netstat -an | grep my_ajp_port" and
>> what OS you are running, someone on the list might be able to better
>> explain the output from the command.
>> 
>> 
>>>> I was expecting to see > 750 Worker Threads in my stack since some extra
>>>> worker threads are needed by Tomcat.  What i saw was around 60 worker
>>>> threads in the trace.
>> 
>> This would be the correct number of threads in use.
>> 
>> Dan
>> 
>> 
>>>> 
>>>> Any suggestions/ideas on why that would be?
>>>> 
>>>> Cheers,
>>>> Charles
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
>> 


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

Reply via email to