Hi Phil,
Answers below.
Le 21/05/2013 14:48, Philip Newlon a �crit :
> Our Tomcat server listens on port 8080. We have ~900 client devices
> that check in with the server once a minute.
>
> JavaMelody http session stats (1 week) indicate that there is a
> continuous average of 50,000 alive http sessions. I sampled
> connections reported by netstat at 15 second intervals for two days
> and found that there was an average of 32 open connections at any time
> (max 43). I put a sniffer on a conversation and found that the
> connection lasted 205ms, ending in a TCP RESET from the client thus
> actively terminating the http session. When I looked at 'active http
> sessions' in JavaMelody a few moments ago, there were 32,700 alive
> sessions. All sessions had the same 'last access' and 'age'
> indicating to me that what I am seeing with a sniffer is correct - the
> client opens the session, does its thing, then terminates and never
> talks again on that connection.
>
> - what constitutes an http session to JavaMelody?
This is an http session as in JavaEE Servlet API:
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSession.html
Http sessions are created by your webapp, when one the two getSession
methods is called for an http request:
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getSession%28boolean%29
> - if a client actively disconnects a session with a TCP RESET, why
> would the session appear to remain alive in JavaMelody stats?
Http sessions in servlet api are invalidated by some logout action or by
a timeout (30 minutes typically), not by TCP RESET.
> - what terminates the reported session except time?
Except waiting for the timeout, your webapp can call invalidate on each
http session, or ... see next:
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSession.html#invalidate%28%29
> - is this discrepancy (50,000 alive sessions versus 32 TCP
> connections) a JavaMelody-ism or Tomcat-ism?
>
Neither of the two, your webapp should probably call
HttpSession.invalidate(), or better it should not create any http
session for stateless requests.
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "javamelody" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
javamelody+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>