Hi,
I'm trying to better understand how set timeout, gc-interval and size
parameters work.
Consider a set with timeout 30m, gc-interval 60m and size 1000*:
In the following, the set begins with no elements. Then elements are
added but never updated.
1) At "time 0" (on both timeout timer and gc-interval timer, here
assumed synchronized for simplicity) the first element e0 is added.
2) Until 20m, 999 more elements e1 - e999 are added.
The set now contains its maximum 1000 elements, e0 - e999.
3) At 20m, nftables (through packet path) attempts to add element e1000.
Does e1000 get added to the set?
What elements are in the set after this attempted add?
4) Until 50m no more elements are added.
At 50m all elements have reached timeout.
What elements are now in the set?
5) From 50m - 55m nftables attempts to add 100 packets e1001 - e1100.
Although all previous elements have reached timeout, garbage collection
has not yet taken place.
At 55m, what elements are in the set?
6) From 55m - 60m no more elements are added.
At 60m the first garbage collection triggers.
Does the set contain the same elements before and after garbage collection?
* This may well be an inadvisable combination of parameter values, but I
hope they're useful in understanding how they affect the behavior of the
example set.
As an aside, does anyone know what effective gc-interval is used if it's
not explicitly specified?
Thanks for your help,
Frank