R:Re: Questions about early_drop()
Quoted 7 lines · [email protected] wrote:
Hi Patrick,
thanks for the explanation. The only thing I do not understand is:Quoted 3 lines
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.
Quoted 6 lines
I understand that this comes from hash tables theory, but I don't get it... When
conntrack_coremodule is loaded, the maximum number of conntrack entries is calculated as (hashsize * 8), so whenearly_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.
Quoted 4 lines · Patrick McHardy
The default is not properly sized, its a trade-off between memory use and performance. A good size would be 2 *
max_entriessince 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