I'll take Pid's suggestion of trying VisualVM and I've been using Jprofiler but don't think i was using it correctly. I'll use those and report later.
Thanks for all the help, starting to feel like I'm getting somewhere! Cheers, Charles On Tue, Oct 23, 2012 at 3:53 PM, Pid <p...@pidster.com> wrote: > On 23/10/2012 19:46, Charles Richard wrote: > > With wc removed, it looked like the following: > > > > tcp 0 0 127.0.0.1:8009 127.0.0.1:37744 > > ESTABLISHED > > tcp 0 0 127.0.0.1:8009 127.0.0.1:36976 > > ESTABLISHED > > tcp 0 0 127.0.0.1:8009 127.0.0.1:35695 > > ESTABLISHED > > tcp 0 0 127.0.0.1:8009 127.0.0.1:39022 > > ESTABLISHED > > > > At the exception of a few close_wait and a few fin_wait2. > > > > If in my jstack analysis, all worker threads are running and all GC > threads > > are running and my server was CPU bound, would i be correct in assuming > > Garbage collection was killing tomcat? Tomcat would eventually not > respond > > anymore which I was trying to understand why as my jstack dump shows > > TP-Processor threads waiting. > > One thread dump from jstack is interesting but not particularly > informative. > > If you see the same in a series of thread dumps, taken a few seconds > apart then you can tell what's happening. > > Alternatively... like Daniel suggested, you do all of the above and more > in a nice shiny GUI, where you don't have to guess what the threads are > doing & where you can see a GC graph alongside at the same time. > > We _strongly_ recommend getting JMX set up & using VisualVM to see > what's happening... > > > p > > > > Thanks! > > > > Cheers, > > Charles > > > > On Tue, Oct 23, 2012 at 2:22 PM, Daniel Mikusa <dmik...@vmware.com> > wrote: > > > >> 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 > >> > >> > > > > > -- > > [key:62590808] > >