memtune
--domain
<domain-identifier>
--hard-limit
<limit>
--soft-limit
<limit>
--swap-hard-limit
<limit>
--min-guarantee
<quantity>
Name | Required? | Description |
---|---|---|
--domain <domain-identifier>
|
required
|
The name, id, or UUID of the guest domain
The word "--domain" itself is optional.
|
--hard-limit <limit>
|
optional
|
Maximum memory the guest domain can use.
Limit is in kilobytes.
Applies to QEMU and LXC only.
|
--soft-limit <limit>
|
optional
|
A soft limit is enforced when the host is running short on free resources or during resource contention. The guest domains' resources are then reduced to the soft-limit as an attempt to regain free resources.
Limit is in kilobytes.
Applies to QEMU and LXC only.
|
--swap-hard-limit <limit>
|
optional
|
Maximum swap memory the guest domain can use.
Limit is in kilobytes.
Applies to QEMU and LXC only.
|
--min-guarantee <quantity>
|
optional
|
Minimum amount of memory required to start a guest domain.
Quantity is in kilobytes.
VMware ESX and vSphere only.
|
virsh # memtune domain-id
virsh # memtune domain-id --hard-limit kilobytes
virsh # memtune domain-id --soft-limit kilobytes
virsh # memtune domain-id --swap-hard-limit kilobytes
<memtune> <hard_limit>131072</hard_limit> <soft_limit>65536</soft_limit> <swap_hard_limit>262144</swap_hard_limit> </memtune>
virsh # memtune lxcbb1 hard_limit : 131072 soft_limit : 65536 swap_hard_limit: 262144
virsh # memtune lxcbb1 --hard-limit 262144
virsh # memtune lxcbb1 hard_limit : 262144 soft_limit : 65536 swap_hard_limit: 262144