[avahi] limit on dbus client objects

Lennart Poettering lennart at poettering.net
Thu Oct 11 17:02:09 PDT 2007


On Thu, 04.10.07 10:13, Brian Gerkey (brian at gerkey.org) wrote:

> Using the Avahi-Bonjour layer on Linux, I quickly get errors during
> service registration that I eventually tracked down to the
> "max_connections_per_user" limit in /etc/dbus-1/system.d/avahi-
> dbus.conf (this is an Ubuntu Dapper box).  This limit defaults to 20,
> and it seems that every time I initialize a new DNSServiceRef (e.g.,
> by registering a service), it uses one of these connections.  Clearly
> I can raise this limit, but that's not a great solution because all
> of my users would have to do the same.
>
> I don't have this problem running the exact same code under OS X with
> mDNSResponder.
>
> Three questions:
>
> - Is there a way to avoid this problem while still using the Bonjour
> API?  E.g., can I get the Avahi-Bonjour layer to reuse its dbus
> client connection somehow?

No. In Bonjour every sdref means one connection to the server. It's a
limitation of Bonjour. Consider using our native API for a more
resource-saving API.

> - If I move to the native Avahi API, will I have a similar problem
> with a single process that registers many services?

We enforce a limit of 250 objects (entry groups, browsers, resolvers)
per client connection. Which is more than any reasonable client should
ever need. If yours does, you are probably abusing mDNS/DNS-SD in
some way, because it is not intended to be *that* scalable.

> - Independent of the Zeroconf implementation that's being used, are
> there drawbacks in general to registering and browsing large numbers
> of services?

Yes. They cost resources, mostly in network traffic. The less you have
the less traffic is generated.

May I ask you to elaborate a little why you need so many services per
client?

Lennart

--
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4


More information about the avahi mailing list