On Jan 18, 5:35*am, buck <b...@private.mil> wrote:
> Andrew Jsyqf <andrew.js...@gmail.com> wrote in news:b3b0759f-d797-415a-
> a38d-a27178f00...@p36g2000prp.googlegroups.com:
>
> > Buck, thanks for your valuable post very much. I have little knowledge
> > about connection track before, as common network books or courses
> > don't mention it at all. I tried to find some related topic by google,
> > and most of result seem to be firewall or iptables related (ie.
> >http://www.kalamazoolinux.org/presen...conntrack.html).
> > So I am not sure whether the connection tracking in my mind is same
> > with what you are talking. If yes, what is the relationship with my
> > question? If no, what is the connection tracking please?
>
> Yes, the connection tracking I'm talking about is netfilter.
>
> Check /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout*
> In recent kernels these parameters may have moved, possibly to
> /proc/sys/net/netfilter/
>
> Run a couple of checks:
> cat /proc/net/ip_conntrack
> * The third column is the remaining timeout in seconds.
> egrep -c "ESTAB|TIME" /proc/net/ip_conntrack
>
> This is speculation. *I am not certain that what I am about to say is
> true, but it is what I think is true. *When a connection receives a FIN,
> it switches from ESTABLISHED to TIME_WAIT and waits 5 days for the
> timeout.
> --
> buck
Buck, David, thanks again.
There is a little mistake in your above explanation: When a connection
receives a FIN, the state will be switched from ESTABLISHED to
CLOSE_WAIT, not TIME_WAIT. Well, it is not important.
What makes me confused is why S1 did not receive FIN, and always be in
ESTABLISHED state. David said, some client OS will not send FIN when
connection is closed, because it prevents server from being flooded.
But in my opinion, not only it doesn't help server reduce loading, but
also makes server has to maintain a lot of 'idle' connection. On the
other side, even if missing FIN on server is due to the network issue,
the client OS should be responsible to retransmit the FIN to make sure
server be notified. But in my test, client process exit but server
still contains so many ESTABLISHED connections. So no matter what
number the timeout value is, it should not happen, but it did happen.
Is it a bug of linux kernel? because it only happens when the
connection number is over 10K (not a certain value). If the number of
connection is not to many, everything is ok. If it is a bug, I would
like to submit to kernel.org. If someone can tell me how to fix it (I
really want to do something for kernel, but no chance, no guider),
that will be wonderful.
Any more idea?
Thanks again for all of you.
Andrew