On Fri, Jul 06, 2012 at 02:18:31AM +0200, Anand Buddhdev wrote:
> Thanks for this suggestion James. I found that calling the to_wire()
> method of each message is about as expensive as sending the update, so I
> don't gain much.

I was suggesting not repeatedly calling to_wire() on the message object, rather
using to_wire() once on each RR set as you add it to the message. Something 
like:

 zone = 'foo.com.'
 u = dns.update.Update(zone)
 base_size = len(u.to_wire())
 for rrset in stuff_to_update:
   rrset_size = len(rrset.to_wire())
   if size + rrset_size > max_size:
     send_update(u)
     u = dns.update.Update(zone)
     size = base_size
   u.add(rrset.name, *args)
   size += rrset_size


That's pretty academic now as you've found a better solution :)


> I'm now investigating batching over TCP.
[snip]
> Are there any classes in dnspython for doing this already? I can't seem
> to find any, or perhaps I am misreading the documentation.

None that I know of. Care to write them and submit a patch? ;)


james
-- 
Times flies like an arrow. Fruit flies like bananas.
_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo/dnspython-users

Reply via email to