* Re: R:Re: Questions about early_drop()
[not found] <0016e6d7ea70951fbb04779150de@google.com>
@ 2009-11-05 12:23 ` Patrick McHardy
2009-11-07 15:29 ` Luca Pesce
0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2009-11-05 12:23 UTC (permalink / raw)
To: pesce.luca; +Cc: netfilter-devel
pesce.luca@gmail.com wrote:
> Hi Patrick,
> thanks for the explanation. The only thing I do not understand is:
>
>> It does greatly improve robustness under DoS since with jhash() and a
>> properly sized
>> hash table there's likely only a single entry per bucket.
>
> I understand that this comes from hash tables theory, but I don't get
> it... When conntrack_core module is loaded, the maximum number of
> conntrack entries is calculated as (hashsize * 8), so when early_drop()
> kicks in, the table is full and is containing (hashsize*8) entries...
> how is it possible that in that situation every bucket contains just one
> entry? Shouldn't it contain about 8 entries, as a mean value?
The default is not properly sized, its a trade-off between memory
use and performance. A good size would be 2 * max_entries since
each conntrack is hashed twice.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: R:Re: Questions about early_drop()
2009-11-05 12:23 ` R:Re: Questions about early_drop() Patrick McHardy
@ 2009-11-07 15:29 ` Luca Pesce
0 siblings, 0 replies; 2+ messages in thread
From: Luca Pesce @ 2009-11-07 15:29 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netfilter-devel
On Thu, Nov 5, 2009 at 1:23 PM, Patrick McHardy <kaber@trash.net> wrote:
> The default is not properly sized, its a trade-off between memory
> use and performance. A good size would be 2 * max_entries since
> each conntrack is hashed twice.
>
Ok, I seem to understand: since each tuple is hased in the table,
actually the real table size is double of the nf_conntrack_max
parameter, so to have maximum performance (1 entry per bucket) we
should have a table with size = 2*nf_conntrack_max. Am I right?
Thank you very much for the explanation.
Luca
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-07 15:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <0016e6d7ea70951fbb04779150de@google.com>
2009-11-05 12:23 ` R:Re: Questions about early_drop() Patrick McHardy
2009-11-07 15:29 ` Luca Pesce
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.