Avahi optimisations

Sjoerd Simons sjoerd at luon.net
Mon Feb 25 13:28:51 EST 2008


On Mon, Feb 25, 2008 at 12:21:22PM -0500, Jim Gettys wrote:
> 
> On Mon, 2008-02-25 at 18:08 +0100, Sjoerd Simons wrote:
> > Hi,
> > 
> >   As a result of a talk of Jim, Lennart and some Collabora folks at LCA
> >   there were some suggestions how one could potentially optimise the
> >   network load of avahi. See the commented list below :)
> > 
> >    * play around with the announce intervals, RR TTLs and stuff - We
> >    already changed the hostname RR interval from 2 minutes to 10 minutes.
> >    Upping it even more probably won't make a significant change in the
> >    traffic levels, but makes the time before avahi detects a node is gone
> >    even longer.
> > 
> >    * minimize announced services (starting with dropping _workstation._tcp)
> >      - Dropping _workstation._tcp can be done by setting
> >        publish-workstation=false in the avahi config. This is the only
> >        redundant service we announce. As this is never resolved the impact
> >        of this change will be quite small.
> > 
> >    * Minimize size of announced services (i.e. drop unnecessary data from
> >    TXT) - The biggest item in the TXT of contacts is the key (which is
> >    BIG). But this key is a requirement of bitfrost, so we can't get rid of
> >    it.
> 
> How much of the traffic is the key? 

The key/value pairs in mdnds just for the key is about 625 bytes in a TXT
record of about 792 bytes. Most other RR are in the size range of 16-32
bytes. So the TXT record is by far the biggest RR and > 75% of that is the key.

Ofcourse the TXT record is not always part of a MDNS, but how often it
occurs depends on your usage patterns (A new node in the network always needs
to get the TXT of all others for example). Also it might be included more then
strictly needed (see one of the later point).

> >    * Change timers to give avahi more time to accoumulate and collapse RRs
> >    - Quite some protocol/traffic analysis needs to be done for this one.
> >    And i'm afraid the potential rewards are quite small.
> 
> We're setting up to get data more routinely; hopefully we'll have some
> this week.

That's good to see. Analysing what traffic goes around in a real XO network
might reveal some interesting things.

> >    * Play around with the code that inserts additional data into packets.
> >    - According to lennart avahi inserts both the TXT and the SRV record
> >    when one requests a PTR record as it's quite common to request this
> >        information afterwards. I don't remember seeing this behaviour in
> >        network traces, so this needs to be verified. If it's the case, this
> >        might save a reasonable amount of traffic as our TXT record is huge.
> > 
> > 
> >   Of course, more potential optimisations might be discovered by doing
> >   analysis of the network traffic. But i'm personally afraid that these
> >   will take a huge amount of effort for at best moderate gains (Assuming no
> >   glaring bugs in avahi)
> 
> I also note we do nothing regarding suspend/resume and adjusting
> timeouts properly, per the mdns spec.  Do you have a feel for what the
> effect of implementing that there would be?

Which potentially changes are you specifically referring to here ? I'm not
really aware of potential changes in this respect that could help a lot with
the traffic.

  Sjoerd
-- 
The Wright Bothers weren't the first to fly.  They were just the first
not to crash.



More information about the Devel mailing list