Closed FrankSzendzielarz closed 5 years ago
I suggest a global limiter that applies to the overall rate of new topic creations.
Open question: how to decide which ad is least valuable and so which is evicted.
@zsfelfoldi says:
I've been thinking a bit more about the global limit eviction priority. Now I think it is perfectly fine and simple if we just enforce the same 10 min lifetime for every ad and if registration is limited by the global limit then evict the first ad (regardless of topic importance) whose guaranteed lifetime is over. We just need a per-topic FIFO and a global FIFO. For more popular topics the length of the topic queue will still be limited by per-topic limit. For less popular ones it will be proportional to the total global efforts to register that topic and I think that is fine. Filling most of the table's total allowance with junk is possible but the important thing is that it will not significantly hinder the registration of important and popular topics. For popular topics (where the topic queue size is at its limit) the time of the next round of "competition" only depends on the first expiring ad from the same queue. The only trick is that we should mark the soonest expiring ad for eviction when we first issue a ticket for the next registration in that queue and until that happens we do not select it for eviction based on global limit (which happens much more frequently). So we can be sure that in the next round for "important" topic registration we are actually have an ad to evict and we can register one of the candidates.
The topic discovery mechanism has a global limit on topic advertisements:
There are three possible issues with this that I can see: