SA Bugzilla – Bug 3329
URIDNSBL: optimization needed
Last modified: 2004-04-29 01:25:53 UTC
here is a bit of my log...notice that there is several instances of lookups for the same domain. wouldn't it be more efficient to just look it up once and/or cache the information locally? Apr 29 00:21:57 takahe spamd[1997]: debug: Found Razor2 part: part=0 engine=4 ct=0 cf=0 Apr 29 00:21:57 takahe spamd[1997]: debug: leaving helper-app run mode Apr 29 00:21:57 takahe spamd[1997]: debug: Razor2 results: spam? 0 highest cf score: 0 Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: netcraft.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: netcraft.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: ximian.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: majen.net took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: majen.net took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: netcraft.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: osdn.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: slashdot.org took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: majen.net took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: slashdot.org took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: slashdot.org took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: ximian.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: osdn.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: ximian.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: osdn.com took 2 seconds to look up Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: queries completed: 20 started: 14 Apr 29 00:21:57 takahe spamd[1997]: debug: URIDNSBL: queries active: at Thu Apr 29 00:21:57 2004
not every ticket is priority 1. but this should be looked at. moving to 3.0 queue.
On behalf of my fellow SURBL DNS administrators I thank folks for noting and addressing this. Any reduction in DNS queries will have a large effect in reducing network and name server traffic. FWIW I thought URIDNSBL had some kind of DNS lookup caching already. The debug output looks like redundant queries for the same message.
Subject: Re: URIDNSBL: optimization needed The DNS code has good look-up caching already so duplicate queries should not be going out on the wire, but it is probably faster for SpamAssassin itself to eliminate duplicates inside of the URIDNSBL code instead.
Yes, both sound right. Thanks for the sanity check. :)
looking into this a bit, there doesn't seem to be a problem, the debugging output is just a little misleading. for example: debug: URIDNSBL: kluge.net took 1 seconds to look up debug: URIDNSBL: kluge.net took 1 seconds to look up debug: URIDNSBL: kluge.net took 1 seconds to look up debug: URIDNSBL: kluge.net took 2 seconds to look up so it looks like it's querying the same domain 4 times. but what it's actually doing is doing a bunch of queries _based on_ the domain: >> DNSBL:ws.surbl.org.:kluge.net debug: URIDNSBL: kluge.net took 0 seconds to look up >> DNSBL:be.surbl.org.:kluge.net debug: URIDNSBL: kluge.net took 0 seconds to look up >> DNSBL:sc.surbl.org.:kluge.net debug: URIDNSBL: kluge.net took 0 seconds to look up >> DNSBL:sbl.spamhaus.org.:8.10.80.10 debug: URIDNSBL: kluge.net took 0 seconds to look up So we can add some more debugging output to be clearer about what is actually going on, but there's no efficiency issue here. removing the 3208 block, fyi.
ok, I added the info to the debug output: debug: URIDNSBL: query for kluge.net took 1 seconds to look up (ws.surbl.org.:kluge.net) debug: URIDNSBL: query for kluge.net took 1 seconds to look up (be.surbl.org.:kluge.net) debug: URIDNSBL: query for kluge.net took 1 seconds to look up (sc.surbl.org.:kluge.net) debug: URIDNSBL: query for kluge.net took 2 seconds to look up (sbl.spamhaus.org.:8.10.80.10) r10425