![](/@@/translation-newline)
The set-quota command updates or creates a quota group with the specified set of
![](/@@/translation-newline)
snaps.
![](/@@/translation-newline)
A quota group sets resource limits on the set of snaps or snap services it contains.
![](/@@/translation-newline)
Snaps can be at most in one quota group but quota groups can be nested. Nested quota
![](/@@/translation-newline)
groups are subject to the restriction that the total sum of each existing quota
![](/@@/translation-newline)
in sub-groups cannot exceed that of the parent group the nested groups are part of.
![](/@@/translation-newline)
All provided snaps are appended to the group; to remove a snap from a
![](/@@/translation-newline)
quota group, the entire group must be removed with remove-quota and recreated
![](/@@/translation-newline)
without the snap. To remove a sub-group from the quota group, the
![](/@@/translation-newline)
sub-group must be removed directly with the remove-quota command.
![](/@@/translation-newline)
To set limits on individual services, one or more services can be placed into a
![](/@@/translation-newline)
sub-group. The respective snap for each service must belong to the sub-group's
![](/@@/translation-newline)
parent group. These sub-groups will have the same limitations as nested groups
![](/@@/translation-newline)
which means their combined resource usage cannot exceed the resource limits set
![](/@@/translation-newline)
for the parent group. Sub-groups which contain services cannot have their own
![](/@@/translation-newline)
journal quotas set, and instead automatically inherit any journal quota their
![](/@@/translation-newline)
parent quota group may have.
![](/@@/translation-newline)
The memory limit for a quota group can be increased but not decreased. To
![](/@@/translation-newline)
decrease the memory limit for a quota group, the entire group must be removed
![](/@@/translation-newline)
with the remove-quota command and recreated with a lower limit. Increasing the
![](/@@/translation-newline)
memory limit for a quota group does not restart any services associated with
![](/@@/translation-newline)
snaps in the quota group.
![](/@@/translation-newline)
The CPU limit for a quota group can be both increased and decreased after being
![](/@@/translation-newline)
set on a quota group. The CPU limit can be specified as a single percentage which
![](/@@/translation-newline)
means that the quota group is allowed an overall percentage of the CPU resources. Setting
![](/@@/translation-newline)
it to 50
% m
eans that the quota group is allowed to use up to 50
% o
f all CPU cores
![](/@@/translation-newline)
in the allowed CPU set. Setting the percentage to 2x100
% m
eans that the quota group
![](/@@/translation-newline)
is allowed up to 100
% o
n two cpu cores.
![](/@@/translation-newline)
The CPU set limit for a quota group can be modified to include new cpus, or to remove
![](/@@/translation-newline)
existing cpus from the quota already set.
![](/@@/translation-newline)
The threads limit for a quota group can be increased but not decreased. To
![](/@@/translation-newline)
decrease the threads limit for a quota group, the entire group must be removed
![](/@@/translation-newline)
with the remove-quota command and recreated with a lower limit.
![](/@@/translation-newline)
The journal limits can be increased and decreased after being set on a group.
![](/@@/translation-newline)
Setting a journal limit will cause the snaps in the group to be put into the same
![](/@@/translation-newline)
journal namespace. This will affect the behaviour of the log command.
![](/@@/translation-newline)
New quotas can be set on existing quota groups, but existing quotas cannot be removed
![](/@@/translation-newline)
from a quota group, without removing and recreating the entire group.
![](/@@/translation-newline)
Adding new snaps to a quota group will result in all non-disabled services in
![](/@@/translation-newline)
that snap being restarted.
![](/@@/translation-newline)
An existing sub group cannot be moved from one parent to another.