Difference between revisions of "Resource management using openVZ"

From Notes_Wiki
(Created page with "=Managing various resourced allocated to a container= Resource allocation can be done using '<tt>vzctl set </tt>' command dynamically. The changes can be made persistent by u...")
 
m
Line 1: Line 1:
<yambe:breadcrumb>OpenvZ</yambe:breadcrumb>
=Managing various resourced allocated to a container=
=Managing various resourced allocated to a container=



Revision as of 14:41, 9 January 2013

<yambe:breadcrumb>OpenvZ</yambe:breadcrumb>

Managing various resourced allocated to a container

Resource allocation can be done using 'vzctl set ' command dynamically. The changes can be made persistent by using '--save' option with 'vzctl set' command. The permanent changes are saved in configuration file '/etc/vz/conf/<container_id>.conf' file

I/O priorities for containers

I/O priorities can be set using:

vzctl set <container_id> --ioprio {[0-7]} --save

Here, 0 is higher or better than 7. Default I/O priority is 4. (Read http://wiki.openvz.org/I/O_priorities_for_VE for more details).


Disk space for containers

Disk space allocated to a container can be set using:

vzctl set <container_id> --diskspace <num1>:<num2> --save

Example: 'vzctl set 101 --diskspace 6G:7G --save' to set the space and 'vzctl exec 101 df -h' to verify the setting.

Just configuring diskspace may not be enough. It is recommended to configure inode limits as well. To configure inode limits use:

vzctl set <container_id> --diskinodes <num1>:num2> --save

To enable/disable quota for a particular container use:

vzctl set <container_id> --diskquota {yes|no} --save

Read http://wiki.openvz.org/Disk_quota for more details



Most of the things in this page are learned from http://wiki.openvz.org/Resource_management