02 June 2022

Preventing Snap from consuming resources indiscriminately


The snap daemon can often take up a lot of processing power, RAM and even hog your internet connection if you don't define a specific time during which it is allowed to perform updates.

The solution is provided on the Snap website, but I thought I'd mention it here for easy reference.

For example, if you don't want it to disturb you at all,  you could set it to:

sudo snap set system refresh.timer=fri,3:00-3:01

This is of course, assuming you won't be using the internet on Friday at 3am :-)

 

Other options are (taken from the Snap website):

  • Mondays at 10:00, Fridays at 15:00: sudo snap set system refresh.timer=mon,10:00,,fri,15:00
  • Mondays at 10:00 and 15:00, Fridays at 10:00 and 15:00: sudo snap set system refresh.timer=mon,fri,10:00,15:00
  • Monday to Wednesday and on Friday, twice between 9:00 and 11:10: sudo snap set system refresh.timer=mon-wed,fri,9:00-11:00/2
  • Mondays, some time between 9:00 and 11:00, and on Wednesdays, some time between 22:00 and 23:00: sudo snap set system refresh.timer=mon,9:00~11:00,,wed,22:00~23:00
  • Monday and on Wednesday, at 0:00: sudo snap set system refresh.timer=mon,wed
  • 2nd Monday of the month, through the following Wednesday, between 23:00 and 24:00: sudo snap set system refresh.timer=mon2-wed,23:00-24:00
  • Last Friday of the month, from 23:00 to 1:00 the next day: sudo snap set system refresh.timer=fri5,23:00-01:00

No comments: