PyPdnsRedis icon indicating copy to clipboard operation
PyPdnsRedis copied to clipboard

only update query count if write backend has been specified. fixes #4

Open neonknight opened this issue 7 years ago • 3 comments

neonknight avatar May 04 '18 12:05 neonknight

Can confirm that this PR works on current pdns-server branch (4.1.x). If no -W redis is specified only read access is performed, resulting in a much faster response time from pdns.

The cost is that no statistics are written. Could be an idea to separate the statistics writing into an own thread in an upcoming release. So writing stats would not slow down returning query results.

jahlives avatar May 04 '18 15:05 jahlives

Thanks for this. I'm sorry I am slow to merge - I can't decide whether I disagree with the change or not.

Not sending these writes to the "write backend" was a deliberate choice on my part, to save traffic to the master DB for secondary "stats" that don't need to be synchronized and accurate. I'd rather remove the stats entirely, than force them to all go back to the master.

If recent versions of redis don't allow writes to the slaves, that may be the only way forward here.

BjarniRunar avatar May 18 '18 10:05 BjarniRunar

It is not possible to write to Redis slaves in current version. I even have my doubts this will ever change. Therefore it may indeed be the optimal solution to completely omit writing statistics when reading from a slave.

neonknight avatar May 18 '18 13:05 neonknight