1832882 Members
2565 Online
110048 Solutions
New Discussion

Re: Tomcat

 
Rafael Casero
Regular Advisor

Tomcat

Would syslog tell me if a Tomcat seesion hangs ? or where can I go to see it.
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Tomcat

Shalom,

syslog would probably not tell you if a tomcat session hung. You might look for a core dump in the home or application directory or at the number of tomcat or java sessions in ps -ef

tomcat has a log file of sorts which I've not found helpful, but it does exist and there may be some evidence in there.


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor

Re: Tomcat

First you'll have to define what you mean with "Tomcat session".

Do you mean a running Tomcat process, as seen by the operating system of the server?

If the process becomes unresponsive, it may be in a tight loop doing something repeatedly. In this case, the OS does not see anything wrong: the process is busy doing something... it just happens to be something useless.

If you're using Sun's JVM, sending a "kill -QUIT" to the Java process running Tomcat will cause the JVM to print out a "thread dump" which tells you exactly what the process was doing at the moment. The thread dump goes to the standard output of the Java process... which might be redirected to some log file somewhere, or even /dev/null. So you might have to examine or tweak your set-up a bit to find out where the thread dump goes and catch it.

Or if the process is not consuming any CPU time, it might be waiting for some I/O operation. If your disk is failing or some network resource your program is using is unreachable, this might be the reason. Disk errors usually cause a lot of messages to be sent to the syslog and kernel message buffer (use the command "dmesg" to see it).

Some years ago, we had lots of problems with old Java versions and urlConnect methods, because there wasn't any way to specify a timeout for the connection. Analyzing the thread dumps helped to see what was going on.


Or do you mean a "Tomcat session" as seen by the client with a web browser?

The HTTP protocol does not have a concept of sessions. If an application wishes to have a concept of sessions, it must keep track of the users and their sessions in some way. Common methods are using cookies or embedding some session-identifying information into the URLs.

If a client sees a session hanging, the first thing to examine is: what happens at the Tomcat server end? Has some network problem prevented the client's requests from reaching the server, or has something in the client's request caused the server to become stuck (see above)? The access logs might help to identify whether it is a network problem or not.

MK
MK
Rafael Casero
Regular Advisor

Re: Tomcat

Sorry it was a Tomcat Process... I guess by what your saying is that is very dificult to find a hung Tomcat process.

I would think that when a process is in a loop it will consume lots of cpu.