Redis cache issues

Good morning folks,

I noticed that Unbound will not start if Redis cache is configured but unreachable, can anyone elaborate on the design choice behind this?

Also, I’ve noticed that when the cache connection is refused, Unbound works just fine querying the root servers and returning the answer, however if the connection timeout, aka Redis server shutdown, all queries timeout rendering my DNS useless.

Is this a config issue on my side or also by design?

Best regards,

Bruno Ortega Blanes

Hi Bruno,

Current master branch has an unreleased fix to ignore Redis if not there during startup/reload.

Previously it was not ignored during these events.

Unbound has connection and command timeouts for Redis.
The default is 100ms for both and I believe each query pays the timeout penalty when trying to load and store values.

Maybe we need a backoff timer when Unbound can't connect?

Best regards,
-- Yorgos

Hi Yorgos,
Thanks for replying, I will test the master branch version with the fix, but about the Redis timeout issue during runtime, I noticed Unbound is trying to connect on every single query which doesn't seem optimal, there's a noticeable CPU spike when Redis goes offline and, for some reason I still haven't fully figured out yet, all my queries to Unbound timeout even though I think they are being resolved.

I think a redis-reconnect-interval should alleviate this problem, maybe with 1000ms default or something, after which it attempts to reconnect to Redis.

Best regards,
Bruno Ortega Blanes