You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by a <le...@yahoo.com> on 2013/03/26 23:32:17 UTC

how to monitor the traffic through the connector

Hi,

I have defined a connector for port80. For example,
    <Connector port="80"
               maxThreads="150"
               minSpareThreads="25"
               maxSpareThreads="75"
               enableLookups="false"
               acceptCount="100"
               debug="0"
               connectionTimeout="2000"
               disableUploadTimeout="true"
               compression="on"
               address="192.168.223.5"/>

Is there any way to monitor the statistics that get throught the port?
I need to log when the requst is fail, and I need to know the number of
threads is consumed when the request is fail.

Thanks





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


RE: how to monitor the traffic through the connector

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: Leon Rosenberg [mailto:rosenberg.leon@gmail.com]
> Sent: Thursday, April 04, 2013 2:27 AM
> To: Tomcat Users List
> Subject: Re: how to monitor the traffic through the connector
> 
> On Wed, Apr 3, 2013 at 5:19 PM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > Leon,
> >
> > On 4/1/13 4:44 PM, Leon Rosenberg wrote:
> > >>>
> > >>
> > >> FWIW, I've found jconsole immensely helpful in sorting out blocked
> > >> threads. And none of that manually searching through dumps. Jeff
> > >>
> > >>
> > > MoSKito provides an even easier way to obtain a thread dump via web
> > > interface:
> > >
> > >
> http://server04.test.anotheria.net:8080/moskitodemo/mui/mskThreadsDu
> > > mp
> >
> > Nice.
> >
> > Sorting
> > >
> > by thread id, name, and status would be a very nice feature.
> >
> 
> Yes, absolutely, I will add that to the list.
> 
> 
> >
> > Oracle's JVM's thread dump gives you information about the locks held
> > by a thread so you can find out which two are deadlocked. Is that
> even
> > possible from pure Java code? If so, it would also be critical to
> > tracking-down this kind of problem.
> >
> 
> Yes. You can see locks in the screen, but until now you have to find
> out yourself which two are deadblocked. Making this analysis working
> automagically is indeed great idea.
> I will think about it.
> Thanks for the hints.
> 
> Leon

That's why I like jconsole.  It's live, or live-ish, and when you look at the threads, it will not only tell you which that a thread is waiting on a lock, and which lock, but also which thread currently owns that lock.  It's a little easier to track the lock-chain that way then manually via a thread dump. 
It might take me a bit to find a starting thread (hint, I look at the ones starting http- or the executor ones), but once I find the first lock, it's a quick jump to the offending thread.


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


Re: how to monitor the traffic through the connector

Posted by Leon Rosenberg <ro...@gmail.com>.
On Wed, Apr 3, 2013 at 5:19 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Leon,
>
> On 4/1/13 4:44 PM, Leon Rosenberg wrote:
> >>>
> >>
> >> FWIW, I've found jconsole immensely helpful in sorting out
> >> blocked threads. And none of that manually searching through
> >> dumps. Jeff
> >>
> >>
> > MoSKito provides an even easier way to obtain a thread dump via
> > web interface:
> >
> > http://server04.test.anotheria.net:8080/moskitodemo/mui/mskThreadsDump
>
> Nice.
>
> Sorting
> >
> by thread id, name, and status would be a very nice feature.
>

Yes, absolutely, I will add that to the list.


>
> Oracle's JVM's thread dump gives you information about the locks held
> by a thread so you can find out which two are deadlocked. Is that even
> possible from pure Java code? If so, it would also be critical to
> tracking-down this kind of problem.
>

Yes. You can see locks in the screen, but until now you have to find out
yourself which two are deadblocked. Making this analysis working
automagically is indeed great idea.
I will think about it.
Thanks for the hints.

Leon


>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJRXEh/AAoJEBzwKT+lPKRYMfQP/2YFRdAouSRAZT1SDr8IeLf5
> 5Ahtxl4e9JFfcmVkQ33/ohD2AyKNpwElRE0Ao2ybWLp+bvYQJRU1hl3gfetxsrQG
> S+L1lQg2gR/n0iZZiQ5TTIhSrf+vrnTfA5aHNGe00kgD4cEfDwtt2xqaRTvyt/j0
> bD0Q3s8fCdmYmaD9e/ypcRI3moD5/CRhsWrQiVrCE4Tb2bempvTj7Ey7/r//0znN
> SmdzgkmHcZ0b59SnrJF7PH1CV1EBLE3vbabZQJjEoyrwh09l9zUHzzszVy2+rc0+
> 6JmJvL8BNLWiSkkS7XDCZzt35UaiX1xd39qjLQnIMNp5znAIKUexfNyEP/Yl+Sfz
> TtVKF0CJzwiln8KEWv4YEeMBaUP5AzBcLDX3Bv5dTnE0hDN2dAad5Sbc4Ums1pf9
> aojPyUx4ShtXGtMxkmSr1uXr/xh8t6RjFCSqryHTyFCZvVUAvzbb3QEjZxwRyMQm
> c5EdhkgIFqPBSKyJ6ipp8c066Yp+mxv6MFykgGW9y0QzgiUfLf437l8ERwmu3CrU
> qCi4uxHQMTn200q3/+r8omcrkGzM9ehbdJyq6CyIN/6ONNYH47q3HTTQKNvIUAuz
> R+S3GEIK9xMRDcoz35qFqZsg1E8Js8IRUgvKTrOOh473kr3v6+IBDhseleMBT7x7
> iX5JrgqYDypJCxMeOZfD
> =zILk
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: how to monitor the traffic through the connector

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

Leon,

On 4/1/13 4:44 PM, Leon Rosenberg wrote:
> On Mon, Apr 1, 2013 at 9:52 PM, Jeffrey Janner 
> <Je...@polydyne.com>wrote:
> 
>>> -----Original Message----- From: Daniel Mikusa
>>> [mailto:dmikusa@vmware.com] Sent: Monday, April 01, 2013 1:09
>>> PM To: Tomcat Users List Subject: Re: how to monitor the
>>> traffic through the connector
>>> 
>>> On Apr 1, 2013, at 1:40 PM, a wrote:
>>> 
>>>> Hi,
>>>> 
>>>> Thank you for reply. The servlet of the web application does
>>>> not response to the request after running serveral months.
>>>> The problem can be solved by
>>> restarting the tomcat.
>>>> I want to troubleshoot by monitoring the number of avaliable
>>>> threads or occupied threads.
>>>> 
>>>> Thank you
>>>> 
>>> 
>>> First, don't top post (i.e. reply at the top of your email).
>>> Either reply below the previous response or as typically works
>>> best, inline.
>>> 
>>> Second, when you encounter a problem with your servlet /
>>> Tomcat, take three or four thread dump, separated by 15 - 20
>>> seconds each.  Each thread dump will show you the current
>>> status of all the threads in the JVM.  You can use the thread
>>> dumps to check for block threads and long running processes.
>>> 
>>> Instructions for taking a thread dump.
>>> 
>>> 
>>> https://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_m
>>>
>>> 
y_running_webapp_.3F
>>> 
>>> Dan
>>> 
>> 
>> FWIW, I've found jconsole immensely helpful in sorting out
>> blocked threads. And none of that manually searching through
>> dumps. Jeff
>> 
>> 
> MoSKito provides an even easier way to obtain a thread dump via
> web interface:
> 
> http://server04.test.anotheria.net:8080/moskitodemo/mui/mskThreadsDump

Nice.

Sorting
> 
by thread id, name, and status would be a very nice feature.

Oracle's JVM's thread dump gives you information about the locks held
by a thread so you can find out which two are deadlocked. Is that even
possible from pure Java code? If so, it would also be critical to
tracking-down this kind of problem.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRXEh/AAoJEBzwKT+lPKRYMfQP/2YFRdAouSRAZT1SDr8IeLf5
5Ahtxl4e9JFfcmVkQ33/ohD2AyKNpwElRE0Ao2ybWLp+bvYQJRU1hl3gfetxsrQG
S+L1lQg2gR/n0iZZiQ5TTIhSrf+vrnTfA5aHNGe00kgD4cEfDwtt2xqaRTvyt/j0
bD0Q3s8fCdmYmaD9e/ypcRI3moD5/CRhsWrQiVrCE4Tb2bempvTj7Ey7/r//0znN
SmdzgkmHcZ0b59SnrJF7PH1CV1EBLE3vbabZQJjEoyrwh09l9zUHzzszVy2+rc0+
6JmJvL8BNLWiSkkS7XDCZzt35UaiX1xd39qjLQnIMNp5znAIKUexfNyEP/Yl+Sfz
TtVKF0CJzwiln8KEWv4YEeMBaUP5AzBcLDX3Bv5dTnE0hDN2dAad5Sbc4Ums1pf9
aojPyUx4ShtXGtMxkmSr1uXr/xh8t6RjFCSqryHTyFCZvVUAvzbb3QEjZxwRyMQm
c5EdhkgIFqPBSKyJ6ipp8c066Yp+mxv6MFykgGW9y0QzgiUfLf437l8ERwmu3CrU
qCi4uxHQMTn200q3/+r8omcrkGzM9ehbdJyq6CyIN/6ONNYH47q3HTTQKNvIUAuz
R+S3GEIK9xMRDcoz35qFqZsg1E8Js8IRUgvKTrOOh473kr3v6+IBDhseleMBT7x7
iX5JrgqYDypJCxMeOZfD
=zILk
-----END PGP SIGNATURE-----

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


Re: how to monitor the traffic through the connector

Posted by Leon Rosenberg <ro...@gmail.com>.
On Mon, Apr 1, 2013 at 9:52 PM, Jeffrey Janner
<Je...@polydyne.com>wrote:

> > -----Original Message-----
> > From: Daniel Mikusa [mailto:dmikusa@vmware.com]
> > Sent: Monday, April 01, 2013 1:09 PM
> > To: Tomcat Users List
> > Subject: Re: how to monitor the traffic through the connector
> >
> > On Apr 1, 2013, at 1:40 PM, a wrote:
> >
> > > Hi,
> > >
> > > Thank you for reply.
> > > The servlet of the web application does not response to the request
> > > after running serveral months. The problem can be solved by
> > restarting the tomcat.
> > > I want to troubleshoot by monitoring the number of avaliable threads
> > > or occupied threads.
> > >
> > > Thank you
> > >
> >
> > First, don't top post (i.e. reply at the top of your email).  Either
> > reply below the previous response or as typically works best, inline.
> >
> > Second, when you encounter a problem with your servlet / Tomcat, take
> > three or four thread dump, separated by 15 - 20 seconds each.  Each
> > thread dump will show you the current status of all the threads in the
> > JVM.  You can use the thread dumps to check for block threads and long
> > running processes.
> >
> > Instructions for taking a thread dump.
> >
> >
> > https://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_m
> > y_running_webapp_.3F
> >
> > Dan
> >
>
> FWIW, I've found jconsole immensely helpful in sorting out blocked
> threads. And none of that manually searching through dumps.
> Jeff
>
>
MoSKito provides an even easier way to obtain a thread dump via web
interface:

http://server04.test.anotheria.net:8080/moskitodemo/mui/mskThreadsDump

learn more at http://moskito.anotheria.net

regards
Leon



> >
> > >
> > >
> > > "Daniel Mikusa" <dm...@vmware.com> wrote in message
> > > news:23DE8F95-CA84-4956-9FDB-2987F1AAA19B@vmware.com...
> > > On Mar 26, 2013, at 6:32 PM, a wrote:
> > >
> > >> Hi,
> > >>
> > >> I have defined a connector for port80. For example,
> > >>   <Connector port="80"
> > >>              maxThreads="150"
> > >>              minSpareThreads="25"
> > >>              maxSpareThreads="75"
> > >>              enableLookups="false"
> > >>              acceptCount="100"
> > >>              debug="0"
> > >>              connectionTimeout="2000"
> > >>              disableUploadTimeout="true"
> > >>              compression="on"
> > >>              address="192.168.223.5"/>
> > >>
> > >> Is there any way to monitor the statistics that get throught the
> > port?
> > >
> > > No idea what you mean by this.  Can you elaborate?
> > >
> > >> I need to log when the requst is fail,
> > >
> > > Do you have an access log valve setup?  That will log the HTTP status
> > code.
> > > You can grep for 500 to get the errors.
> > >
> > >
> > > https://tomcat.apache.org/tomcat-7.0-
> > doc/config/valve.html#Access_Log_
> > > Valve
> > >
> > >> and I need to know the number of
> > >> threads is consumed when the request is fail.
> > >
> > > The access log valve can tell you the thread name of the thread that
> > > handled your request with the "%I" option.  I'm not sure there's an
> > > easy way to get the total threads in use at the time a request fails
> > > though.  What is your rationale for needing this information?
> > >
> > > Dan
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: how to monitor the traffic through the connector

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

Jeffrey,

On 4/1/13 3:52 PM, Jeffrey Janner wrote:
>> -----Original Message----- From: Daniel Mikusa
>> [mailto:dmikusa@vmware.com] Sent: Monday, April 01, 2013 1:09 PM 
>> To: Tomcat Users List Subject: Re: how to monitor the traffic
>> through the connector
>> 
>> On Apr 1, 2013, at 1:40 PM, a wrote:
>> 
>>> Hi,
>>> 
>>> Thank you for reply. The servlet of the web application does
>>> not response to the request after running serveral months. The
>>> problem can be solved by
>> restarting the tomcat.
>>> I want to troubleshoot by monitoring the number of avaliable
>>> threads or occupied threads.
>>> 
>>> Thank you
>>> 
>> 
>> First, don't top post (i.e. reply at the top of your email).
>> Either reply below the previous response or as typically works
>> best, inline.
>> 
>> Second, when you encounter a problem with your servlet / Tomcat,
>> take three or four thread dump, separated by 15 - 20 seconds
>> each.  Each thread dump will show you the current status of all
>> the threads in the JVM.  You can use the thread dumps to check
>> for block threads and long running processes.
>> 
>> Instructions for taking a thread dump.
>> 
>> 
>> https://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_m
>>
>> 
y_running_webapp_.3F
>> 
>> Dan
>> 
> 
> FWIW, I've found jconsole immensely helpful in sorting out blocked
> threads. And none of that manually searching through dumps.

Jconsole is notoriously difficult to get running on a remote server
(unless it's running Microsoft Windows, but then again I can't imagine
a Windows server that stays running for "several months" where the
webapp turns out to be the problem ;).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRXEfkAAoJEBzwKT+lPKRYKPUQAJIshzZVPoxPaqbBGLb6IzXe
ChSiwK40Jo/LtniAxMkpgtraXXCatDCLK9TZKrc7QsnaYePcJTTuJylYF/cbDox9
6SvFMOWlvbm4ZX+Qj7jnKj5UkNIbuws7PHEFtD5s+2HyuXe5DSl/xTwlbW25cAi6
GwXI/HbhwwFAqLWkgf9AMyfA8SQT0YEYmC8hhBtz6lfJYP0xiN6oqeIuOgnJAFJf
YU+ITSyiKyqHboNjnoz4OtTgQGbxVuGjeAeJKVjTJVL2qpHmVWHekV53/4Qps/nk
vW55K3ah7K+e0xETZpHE1Wdbse189DDM2GEWvoEGANHjLnvJ19ugvs08IQ4xIR19
orZmSBf7RSFqR6MSwT2N6YrFTKnGij/yQXYg6oxJkF0/0Ep6frWxf8xfUis5+Muo
/WcsW5nNFbrFHDWuAifPNT1HPXVtftJ/VxZs43Fsht6618pfFZMpQStqmUUWmbVb
31uTaZk7karGhdQuMFqQNMLhUcj6jhsZEQJPiozO/oc2GUznQfz8TcaRVhtiElxf
PEUICU23hBVOHqOhfozmC5a1opFVbpSTvH2KHcdAkaJB1NrBtsKcA0GPTH8S4E5K
y6Ld3TdrLXvpuu6d1tyfLtkaMixT5GnqbALiOPLvZFOKoSw99VQCUpj+NBeMvn5M
RRrBwOu10/oV64H9SNvP
=mPr8
-----END PGP SIGNATURE-----

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


RE: how to monitor the traffic through the connector

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: Daniel Mikusa [mailto:dmikusa@vmware.com]
> Sent: Monday, April 01, 2013 1:09 PM
> To: Tomcat Users List
> Subject: Re: how to monitor the traffic through the connector
> 
> On Apr 1, 2013, at 1:40 PM, a wrote:
> 
> > Hi,
> >
> > Thank you for reply.
> > The servlet of the web application does not response to the request
> > after running serveral months. The problem can be solved by
> restarting the tomcat.
> > I want to troubleshoot by monitoring the number of avaliable threads
> > or occupied threads.
> >
> > Thank you
> >
> 
> First, don't top post (i.e. reply at the top of your email).  Either
> reply below the previous response or as typically works best, inline.
> 
> Second, when you encounter a problem with your servlet / Tomcat, take
> three or four thread dump, separated by 15 - 20 seconds each.  Each
> thread dump will show you the current status of all the threads in the
> JVM.  You can use the thread dumps to check for block threads and long
> running processes.
> 
> Instructions for taking a thread dump.
> 
> 
> https://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_m
> y_running_webapp_.3F
> 
> Dan
> 

FWIW, I've found jconsole immensely helpful in sorting out blocked threads. And none of that manually searching through dumps.
Jeff

> 
> >
> >
> > "Daniel Mikusa" <dm...@vmware.com> wrote in message
> > news:23DE8F95-CA84-4956-9FDB-2987F1AAA19B@vmware.com...
> > On Mar 26, 2013, at 6:32 PM, a wrote:
> >
> >> Hi,
> >>
> >> I have defined a connector for port80. For example,
> >>   <Connector port="80"
> >>              maxThreads="150"
> >>              minSpareThreads="25"
> >>              maxSpareThreads="75"
> >>              enableLookups="false"
> >>              acceptCount="100"
> >>              debug="0"
> >>              connectionTimeout="2000"
> >>              disableUploadTimeout="true"
> >>              compression="on"
> >>              address="192.168.223.5"/>
> >>
> >> Is there any way to monitor the statistics that get throught the
> port?
> >
> > No idea what you mean by this.  Can you elaborate?
> >
> >> I need to log when the requst is fail,
> >
> > Do you have an access log valve setup?  That will log the HTTP status
> code.
> > You can grep for 500 to get the errors.
> >
> >
> > https://tomcat.apache.org/tomcat-7.0-
> doc/config/valve.html#Access_Log_
> > Valve
> >
> >> and I need to know the number of
> >> threads is consumed when the request is fail.
> >
> > The access log valve can tell you the thread name of the thread that
> > handled your request with the "%I" option.  I'm not sure there's an
> > easy way to get the total threads in use at the time a request fails
> > though.  What is your rationale for needing this information?
> >
> > Dan



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


Re: how to monitor the traffic through the connector

Posted by Daniel Mikusa <dm...@vmware.com>.
On Apr 1, 2013, at 1:40 PM, a wrote:

> Hi,
> 
> Thank you for reply.
> The servlet of the web application does not response to the request after 
> running serveral months. The problem can be solved by restarting the tomcat. 
> I want to troubleshoot by monitoring the number of avaliable threads or 
> occupied threads.
> 
> Thank you
> 

First, don't top post (i.e. reply at the top of your email).  Either reply below the previous response or as typically works best, inline.

Second, when you encounter a problem with your servlet / Tomcat, take three or four thread dump, separated by 15 - 20 seconds each.  Each thread dump will show you the current status of all the threads in the JVM.  You can use the thread dumps to check for block threads and long running processes.

Instructions for taking a thread dump.

  https://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F

Dan


> 
> 
> "Daniel Mikusa" <dm...@vmware.com> wrote in message 
> news:23DE8F95-CA84-4956-9FDB-2987F1AAA19B@vmware.com...
> On Mar 26, 2013, at 6:32 PM, a wrote:
> 
>> Hi,
>> 
>> I have defined a connector for port80. For example,
>>   <Connector port="80"
>>              maxThreads="150"
>>              minSpareThreads="25"
>>              maxSpareThreads="75"
>>              enableLookups="false"
>>              acceptCount="100"
>>              debug="0"
>>              connectionTimeout="2000"
>>              disableUploadTimeout="true"
>>              compression="on"
>>              address="192.168.223.5"/>
>> 
>> Is there any way to monitor the statistics that get throught the port?
> 
> No idea what you mean by this.  Can you elaborate?
> 
>> I need to log when the requst is fail,
> 
> Do you have an access log valve setup?  That will log the HTTP status code. 
> You can grep for 500 to get the errors.
> 
>  https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve
> 
>> and I need to know the number of
>> threads is consumed when the request is fail.
> 
> The access log valve can tell you the thread name of the thread that handled 
> your request with the "%I" option.  I'm not sure there's an easy way to get 
> the total threads in use at the time a request fails though.  What is your 
> rationale for needing this information?
> 
> Dan
> 
> 
>> 
>> Thanks
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


Re: how to monitor the traffic through the connector

Posted by a <le...@yahoo.com>.
Hi,

Thank you for reply.
The servlet of the web application does not response to the request after 
running serveral months. The problem can be solved by restarting the tomcat. 
I want to troubleshoot by monitoring the number of avaliable threads or 
occupied threads.

Thank you



"Daniel Mikusa" <dm...@vmware.com> wrote in message 
news:23DE8F95-CA84-4956-9FDB-2987F1AAA19B@vmware.com...
On Mar 26, 2013, at 6:32 PM, a wrote:

> Hi,
>
> I have defined a connector for port80. For example,
>    <Connector port="80"
>               maxThreads="150"
>               minSpareThreads="25"
>               maxSpareThreads="75"
>               enableLookups="false"
>               acceptCount="100"
>               debug="0"
>               connectionTimeout="2000"
>               disableUploadTimeout="true"
>               compression="on"
>               address="192.168.223.5"/>
>
> Is there any way to monitor the statistics that get throught the port?

No idea what you mean by this.  Can you elaborate?

> I need to log when the requst is fail,

Do you have an access log valve setup?  That will log the HTTP status code. 
You can grep for 500 to get the errors.

  https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve

> and I need to know the number of
> threads is consumed when the request is fail.

The access log valve can tell you the thread name of the thread that handled 
your request with the "%I" option.  I'm not sure there's an easy way to get 
the total threads in use at the time a request fails though.  What is your 
rationale for needing this information?

Dan


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




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


Re: how to monitor the traffic through the connector

Posted by Daniel Mikusa <dm...@vmware.com>.
On Mar 26, 2013, at 6:32 PM, a wrote:

> Hi,
> 
> I have defined a connector for port80. For example,
>    <Connector port="80"
>               maxThreads="150"
>               minSpareThreads="25"
>               maxSpareThreads="75"
>               enableLookups="false"
>               acceptCount="100"
>               debug="0"
>               connectionTimeout="2000"
>               disableUploadTimeout="true"
>               compression="on"
>               address="192.168.223.5"/>
> 
> Is there any way to monitor the statistics that get throught the port?

No idea what you mean by this.  Can you elaborate?

> I need to log when the requst is fail,

Do you have an access log valve setup?  That will log the HTTP status code.  You can grep for 500 to get the errors.

  https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve

> and I need to know the number of
> threads is consumed when the request is fail.

The access log valve can tell you the thread name of the thread that handled your request with the "%I" option.  I'm not sure there's an easy way to get the total threads in use at the time a request fails though.  What is your rationale for needing this information?

Dan


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


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