----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
> From: Andras Balogh[SMTP:[EMAIL PROTECTED]]
> Subject: Re: Many JServ threads being made and dying
>
> Hello all,
>
> I have seen a lot of discussion about using
> ps -aux and netstat -a commands to determine
> how many native threads are running and how many TCP connections
> are made on port 8007.
> My problem is i don't understand such things as TIME_WAIT and a lot
> of other shortnames.
>
> Wainting for your opinions,
>
> Andras.
>
Understanding the output of netstat is a bit more involved than meets the
eye. The tool gives a lot of details about the status of the entire IP
stack, which requires a fair understanding of the IP protocols (like UDP and
TCP) to interpret.
The best reference for understanding things like TIME_WAIT is
TCPIP/IP Illustrated, Volume 1 (The Protocols)
W. Richard Stevens
(c) 1994 Addison Wesley Longman, Inc.
ISBN 0-201-63346-9
In section 18.6 (TCP State Transition Diagram) on page 241 there is an
excellent explanation of the client and the server in a TCP communication.
There is a series of "signals" (ACK, SYN, RST, FIN) that get sent back and
forth which allow the client and server to confirm that a connection has
been made, that either side is ready to terminate the connection, that the
other side can confirmed receipt of the termination request, etc. These
signals, and the client and server "states" that are associated with them
allow for the robust guarantee that a connection is still up, that the other
side of the connection is still receiving, etc.
(Any book written by Steven should be on your bookshelf if you want to get
into good hardcore UNIX programming. He is a great and respected author.)
Anyway, when the server process (in this case, the owner of port 8007 which
is the JVM process) "closes" a TCP connection, the last communication is an
"ACK" signal sent from the server. The server then politely waits for a
certain timeout period to make sure the client received the "ACK". I believe
this timeout period allows the client to send a complaint if for some reason
the server's "ACK" got lost in transit.
The timeout period (if I understand correctly) is based on the estimated
round-trip message time between client and server. Since (in most simple
cases) the client and server are on the same machine, I think the timeout is
something like 20-30 seconds.
For there to be constantly about 10 TIME_WAIT TCP connections showing up, I
infer that the JVM threads are establishing and disconnecting constantly.
The higher the frequency of connections and disconnections, the more
TIME_WAIT lines you'll find lingering.
The point I'm trying to make is that this is an indication that there are a
bunch of connections being made to the JVM (and threads correspondingly
being created and destroyed) even when the server is idle and no servlets
are being run.
Murray
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]