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