On Tue, Jan 19, 2010 at 2:16 AM, Michal Charemza <[email protected]> wrote: > A cunning method. But I am curious: > > - How long would a connection remain established? Once everything from a > page has downloaded, is the connection closed? (I ask as although this would > definitely show an accurate how many connections the server has, this might > not be a useful figure. I assumed "how many users viewed a page in the last X > minutes" is actually what is being asked for. ) >
Once the page has been displayed, the socket is still open and goes to FIN_WAIT_2 state (which you can grep from netstat) until the server closes it. Clients are supposed to acknowledge the server in order to close it, but some buggy clients don't. I dunno exactly how long the connection is kept open... I think it's dependent on the web server's keep-alive timeout value. There's also an OS-specific value for FIN_WAIT_2, which can be set via sysctl. In my FreeBSD box, sysctl -a net.inet.tcp | grep finwait2_timeout gives me: net.inet.tcp.finwait2_timeout: 60000 YMMV.... > - On a shared server, would this count *all* connections to all sites? LOL... I've never thought of that. Yes, it'll count the connections for all sites.... Maybe we can just grep the server's log file for HTTP GET requests so that we can have a generic counter or something... [ simon.cpu ] _______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
