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" <[email protected]> wrote in message > news:[email protected]... > 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: [email protected] >> For additional commands, e-mail: [email protected] >> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
