Supervisor memory and cpu limit for addons

The way addons work in Home Assistant is great, each addon in it’s own container fantastic.

Lately after experimenting issues with node red memory leaking and locking down my system, therefore crashing Home Assistant. I figured It would be very nice if we could specify (memory and cpu) limits in each addon config file, I think It should be fairly easy to do, since is a feature docker supports natively.

An example would be:

Addon config

  - username: user
    password: password
anonymous: false
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
# New fields
      cpus: '0.50'
      memory: 50M
    on_limit: restart # what to do when limit is reached

Currently don’t have enough knowledge of the code base or python to implement it, still something like this I figure would have to be discussed previously.

Agreed, it should be a must have and at least we should be possible to give High, Normal Low shares level. (or only Normal and Low, and let High be reservered for core Home Assistent features…)