Snapd – Why Does the Snapd Service Use So Much Data?

18.04internetnethogssnap

I am on Ubuntu 18.04 LTS. Updated the system to the latest. Recently I noticed something unusual on Ubuntu with my Internet connection. My limited Internet quota was used up quickly by something invisible. As a user came from Windows this was something odd as Ubuntu never did such a thing to me. I installed nethogs and found out that the devil who vanished my data was /usr/lib/snapd/snapd

I found a somewhat similar question, but it does not answer what I am going to ask. Removing snapd from start up did not help either.

  • Why does snapd use this much data?
  • Is there a way to stop those connections without disabling snap apps?

    nethogs interface showing culprit

Best Answer

By default, snaps are set to refresh themselves 4 times per day. If you are using many snaps, this could be a data intensive process for you.

Perhaps limiting the number of times per day that the snaps refresh would help. You can adjust this on your system with

sudo snap set system refresh.timer=fri,15:00

to set the update of snaps to occur on Friday at 15:00, or tell snapd that you are using a metered connection:

sudo snap set system refresh.metered=hold

I suspect (but cannot prove) that snapd looks at the "Restrict Background Data" flag of the network connection (as shown in the image below), to determine that the connection is metered. If you choose to set your connections to "metered" then to update your snaps, you will need to

sudo snap refresh

on occastion, just as you would occasionally sudo apt update and sudo apt upgrade

=====

For more information on this, please see https://docs.snapcraft.io/system-options/87

enter image description here

Related Question