avahi-daemon high cpu, unusable networking

Bug #1799265 reported by Matt on 2018-10-22
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Avahi
New
Unknown
avahi (Ubuntu)
High
Trent Lloyd

Bug Description

Currently running Kubuntu 18.10, Dell XPS 13 9350

Since updating from Kubuntu 18.04 to 18.10, the avahi-daemon has been consistently hampering network performance and using CPU for long periods of time.

When booting machine from off state, avahi-daemon uses an entire CPU at max load for approx 10 minutes. During this time, internet connectivity via wifi is essentially unusable. The wifi connection is good, but it seems that http transactions are cutoff mid-way so no webpage is able to load.

When waking from sleep, the avahi-daemon causes similar symptoms, but with less than 1 full cpu usage, and with somewhat less degraded network performance, but still quite unusable.

I have never had issues with avahi prior to the 18.10 upgrade, so I am fairly confident the issue is rooted in that change.

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: avahi-daemon 0.7-4ubuntu2
ProcVersionSignature: Ubuntu 4.18.0-10.11-generic 4.18.12
Uname: Linux 4.18.0-10-generic x86_64
ApportVersion: 2.20.10-0ubuntu13
Architecture: amd64
CurrentDesktop: KDE
Date: Mon Oct 22 10:00:34 2018
InstallationDate: Installed on 2017-07-24 (455 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 LD_PRELOAD=<set>
 SHELL=/bin/bash
SourcePackage: avahi
UpgradeStatus: Upgraded to cosmic on 2018-10-20 (2 days ago)

Matt (mryumyum) wrote :
Trent Lloyd (lathiat) wrote :

Hi Matt,

Thanks for the report. I'd like to profile avahi using perf to get information on what functions are being executed. Could you run the following commands to generate such data?

If you are unsure about any of this feel free to ask.

echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list
sudo apt update
sudo apt install linux-tools-generic ubuntu-dbgsym-keyring linux-cloud-tools-generic
sudo apt update
sudo apt install avahi-daemon-dbgsym libavahi-common3-dbgsym libavahi-core7-dbgsym libavahi-glib1-dbgsym libc6-dbgsym libcap2-dbgsym libdaemon0-dbgsym libdbus-1-3-dbgsym libecore-avahi1-dbgsym libexpat1-dbgsym libgcrypt20-dbgsym libgpg-error0-dbgsym liblz4-1-dbgsym liblzma5-dbgsym libnss-systemd-dbgsym libsystemd0-dbgsym

then to record a profile:

sudo perf record -p $(cat /run/avahi-daemon/pid) -g -- sleep 60

This will exit after 60 seconds, then generate perf script output:

sudo perf script > avahi-perf.script.txt
sudo perf report -n --stdio > avahi-perf.report.txt

And then upload the resulting avahi-perf.script.txt and avahi-perf.report.txt for analysis.

You'll want to make sure avahi is using 100%+ CPU at the time you do this.

Lastly from the same bootup, can you please collect the log info from journalctl:
journalctl -u avahi-daemon --no-pager --no-tail > avahi-journal.txt

Thanks for reporting the bug! Hopefully we can figure it out.

In the mean time if you want to disable avahi you can try this:
sudo systemctl disable avahi-daemon.socket avahi-daemon
sudo systemctl stop avahi-daemon.socket avahi-daemon

(to re-enable change to start and enable)

Regards,
Trent

Changed in avahi (Ubuntu):
status: New → Incomplete
importance: Undecided → High
Matt (mryumyum) wrote :

Ok, the issue seems gone! I cannot recreate it, and I'm not sure why.

First, thank you for the quick reply. When I first read your response, I ran the

`echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list`

command, and then realized the CPU wasn't being maximally taxed so I didn't continue and decided to try again later. I then ran the disable and stop commands to get rid of the issue temporarily.

I later decided to try to recreate the issue, so I ran the corresponding enable and start commands, and the CPU didn't increase. I then restarted my system a couple times, but have yet to see the high CPU and bad networking issues. I can confirm that the avahi-daemon is indeed running. Running `ps aux | grep avahi` yields,

avahi 915 0.0 0.0 18920 3868 ? Ss 23:46 0:00 avahi-daemon: running [tomboy.local]
avahi 1035 0.0 0.0 18716 348 ? S 23:46 0:00 avahi-daemon: chroot helper

Since my initial post I have performed a couple normal package updates, so perhaps one of them solved the issue? The Kubuntu 18.10 I am on is a new release, so perhaps something was discovered and fixed.

Matt (mryumyum) wrote :

Ok, ignore previous post. My laptop was sitting unused and suddenly I hear the fans spin up (which they almost never do). Sure enough, the avahi-daemon was running up a full cpu core. I've attached the logs.

Thanks for looking into it.

Matt (mryumyum) wrote :

Ok, ignore previous post. My laptop was sitting unused and suddenly I hear the fans spin up (which they almost never do). Sure enough, the avahi-daemon was running up a full cpu core. I've attached the logs.

Thanks for looking into it.

Matt (mryumyum) wrote :

Ok, ignore previous post. My laptop was sitting unused and suddenly I hear the fans spin up (which they almost never do). Sure enough, the avahi-daemon was running up a full cpu core. I've attached the logs.

Thanks for looking into it.

Trent Lloyd (lathiat) on 2018-12-17
Changed in avahi (Ubuntu):
status: Incomplete → Triaged
assignee: nobody → Trent Lloyd (lathiat)
Changed in avahi:
status: Unknown → New
Eyal Lotem (eyal-weka) wrote :

A similar bug happened here on 2 different Ubuntu installs once they upgraded to Ubuntu 18.10.

Another symptom of the bug was periodic addition of IPv6 addresses to the `ip addr` listing. If you wait a while, the list had thousands of IPv6 entries in it!

Apparently every time it decided to fetch new IPv6 addresses it also did a RST on all the IPv4 connections, which is why webpages fail to load a lot of the time.

Once I completely disabled IPv6 support on my machine via:

/etc/sysctl.d/99-sysctl.conf:net.ipv6.conf.all.disable_ipv6 = 1
/etc/sysctl.d/99-sysctl.conf:net.ipv6.conf.default.disable_ipv6 = 1
/etc/sysctl.d/99-sysctl.conf:net.ipv6.conf.lo.disable_ipv6 = 1

The problem went away.

So I don't know what the exact problem is -- but this narrows it down.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.