Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Sep 2006 17:03:21 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Mike Silbersack <silby@silby.com>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netinet in_pcb.c tcp_subr.c tcp_timer.c tcp_var.h
Message-ID:  <20060907130321.GA40020@FreeBSD.org>
In-Reply-To: <20060907000939.J12826@odysseus.silby.com>
References:  <200609061356.k86DuZ0w016069@repoman.freebsd.org> <20060906091204.B6691@odysseus.silby.com> <20060906143204.GQ40020@FreeBSD.org> <20060906093553.L6691@odysseus.silby.com> <20060906150129.GT40020@FreeBSD.org> <20060907000939.J12826@odysseus.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 07, 2006 at 12:18:56AM -0500, Mike Silbersack wrote:
M> >I think we should free the oldmost tcptw entry in a case if we can't
M> >find the local endpoint. We can tell definitely that we can't find one
M> >only in in_pcbbind_setup() in the "do {} while (in_pcblookup_local)" cycle,
M> >where EADDRNOTAVAIL is returned. We can't definitely tell this in
M> >in_pcblookup_local() since we don't know whether tried port is the
M> >last one.
M> >
M> >The oldmost tcptw entry can be taken simply from the ordered list, like
M> >tcp_timer_2msl_tw() does this.
M> 
M> That's something along the lines of what I was thinking.  However, I think 
M> it'll be slightly more complex than taking just the oldest entry from the 
M> list.  We could have time_wait states that are for sockets such as 
M> remoteip:ephemeralport <-> localip:80 and also 
M> localip:ephemeralport  <-> remoteip:80.  We'd have to find one of the ones 
M> of the second type to recycle.

It think we need to purge one entry if _we have found a match_ in 
in_pcblookup_local(). And _do not jump_ up to the beginning of the cycle.

M> I think I know why my implementation went so wrong - I was testing the 
M> case where I had http_load (or was it apachebench?) connecting to apache 
M> on another machine.  The case I was trying to solve was where the http 
M> benchmark tool created all the time_wait sockets on the client, thereby 
M> preventing new connections from being made.  In that case, the heuristic 
M> would (probably) recycle the first socket it came upon, and be done.  In 
M> your case, it would recycle the first socket it came upon, but it would be 
M> one of the remoteip:ephemeralport <-> localip:80 sockets, which wouldn't 
M> help it at all.  Does that sound like what was happening?

Probably it does.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060907130321.GA40020>