szmarczak / cacheable-lookup

A cacheable dns.lookup(…) that respects TTL :tada:
MIT License
193 stars 29 forks source link

Very slow when TTL caching is disabled #6

Closed szmarczak closed 4 years ago

szmarczak commented 4 years ago

It's only about 25-250 op/s (compared to millions of op/s when using TTL or to 20-30k when using dns.lookup(...)).

I think the reason is that the DNS server does throttling on purpose.

szmarczak commented 4 years ago

One of the solutions would be: return the cached entry and update the cache in background.

The cache needs to be a separate LRU cache.

szmarczak commented 4 years ago

Currently, I see no reason to do this. I'll reopen the issue if someone finds this interesting.

szmarczak commented 4 years ago

Not anymore. Fixed in 5.0.0.