Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Nov 2012 22:23:48 -0800
From:      Peter Wemm <peter@wemm.org>
To:        Alfred Perlstein <bright@mu.org>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Adrian Chadd <adrian@freebsd.org>
Subject:   Re: auto tuning tcp
Message-ID:  <CAGE5yCoj1dL9w-EMMi8iYMTOq9uUUHmFg4rMY7aPneUBHBv67Q@mail.gmail.com>
In-Reply-To: <50A1E47C.1030208@mu.org>
References:  <50A0A0EF.3020109@mu.org> <50A0A502.1030306@networx.ch> <50A0B8DA.9090409@mu.org> <50A0C0F4.8010706@networx.ch> <EB2C22B5-C18D-4AC2-8694-C5C0D96C07B3@mu.org> <50A13961.1030909@networx.ch> <50A14460.9020504@mu.org> <50A1E2E7.3090705@mu.org> <50A1E47C.1030208@mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 12, 2012 at 10:11 PM, Alfred Perlstein <bright@mu.org> wrote:
> On 11/12/12 10:04 PM, Alfred Perlstein wrote:
>>
>> On 11/12/12 10:48 AM, Alfred Perlstein wrote:
>>>
>>> On 11/12/12 10:01 AM, Andre Oppermann wrote:
>>>>
>>>>
>>>> I've already added the tunable "kern.maxmbufmem" which is in pages.
>>>> That's probably not very convenient to work with.  I can change it
>>>> to a percentage of phymem/kva.  Would that make you happy?
>>>>
>>>
>>> It really makes sense to have the hash table be some relation to sockets
>>> rather than buffers.
>>>
>>> If you are hashing "foo-objects" you want the hash to be some relation to
>>> the max amount of "foo-objects" you'll see, not backwards derived from the
>>> number of "bar-objects" that "foo-objects" contain, right?
>>>
>>> Because we are hashing the sockets, right?   not clusters.
>>>
>>> Maybe I'm wrong?  I'm open to ideas.
>>
>>
>> Hey Andre, the following patch is what I was thinking
>> (uncompiled/untested), it basically rounds up the maxsockets to a power of 2
>> and replaces the default 512 tcb hashsize.
>>
>> It might make sense to make the auto-tuning default to a minimum of 512.
>>
>> There are a number of other hashes with static sizes that could make use
>> of this logic provided it's not upside-down.
>>
>> Any thoughts on this?
>>
>> Tune the tcp pcb hash based on maxsockets.
>> Be more forgiving of poorly chosen tunables by finding a closer power
>> of two rather than clamping down to 512.
>> Index: tcp_subr.c
>> ===================================================================
>
>
> Sorry, GUI mangled the patch... attaching a plain text version.
>
>

Wait, you want to replace a hash with a flat array?  Why even bother
to call it a hash at that point?


-- 
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV
"All of this is for nothing if we don't go to the stars" - JMS/B5
"If Java had true garbage collection, most programs would delete
themselves upon execution." -- Robert Sewell



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