17

It seems that avahi-daemon process, which is unknown to me, is using excessive amounts of CPU on my system

I have tried both htop and system monitor, and only htop show the CPU use. Screenshots are included below.

What can I do to make avahi-daemon behave?

Edit: The issue often occurs when playing the game Dota 2. I've been observing this for a week.

htop

System Monitor System monitor doesn't appear to show which process is consuming CPU, unlike htop.

sudo systemctl status avahi-daemon.s* As requested by @heynnema

Livy
  • 408
  • 1
  • 6
  • 16

2 Answers2

7

Avahi daemon basically a network daemon that broadcasts your machine's IP address to the network. For example A printer broadcast its IP using Avahi daemon saying that "I am a printer and I can print your documents" if you don't have any such devices to be used in the network, you can disable the daemon using the below commands on Ubuntu

sudo systemctl disable avahi-daemon

Sometimes other software starts this daemon, so you can remove them permanently using the below commands.

apt-get remove avahi-daemon
oligofren
  • 679
  • 1
  • 9
  • 24
6

Avahi is required for multiple things regarding network and/or plug and play devices. Disabling it may disable some of services that you might need, depending on your computer use.

It was also consuming my cpu because I am part of large network, with lot's of printers.

What eventually did it for me, without disrupting print functionality is:

sudo nano /etc/avahi/avahi-daemon.conf

find ratelimit-interval-usec= and set it to 500000
find ratelimit-burst= and set that to 500
find enable-wide-area= and set that to no

press ctrl + o then save

restart avahi daemon

sudo systemctl restart avahi-daemon.service

Check CPU usage...

If above doesn't quickly resolve high CPU usage, further limitations can be done in rlimits section of avahi's config file, see man page or:

https://manpages.debian.org/testing/avahi-daemon/avahi-daemon.conf.5.en.html

For detailed instructions.

See this answer for more details about Avahi: https://unix.stackexchange.com/questions/566932/what-is-the-avahi-daemon