
Managing Resources
50
Setting Up Per-VPS Disk Quota Parameters
Three parameters determine how much disk space and inodes a Virtual Private Server can use.
These parameters are specified in the Virtual Private Server configuration file:
DISKSPACE
Total size of disk space that can be consumed by the Virtual Private Server in 1-
Kb blocks. When the space used by the Virtual Private Server hits the soft limit,
the VPS can allocate additional disk space up to the hard limit during the grace
period specified by the
QUOTATIME
parameter.
DISKINODES
Total number of disk inodes (files, directories, and symbolic links) the Virtual
Private Server can allocate. When the number of inodes used by the Virtual
Private Server hits the soft limit, the VPS can create additional file entries up to
the hard limit during the grace period specified by the
QUOTATIME
parameter.
QUOTATIME
The grace period of the disk quota specified in seconds. The Virtual Private
Server is allowed to temporarily exceed the soft limit values for the disk space
and disk inodes quotas for no more than the period specified by this parameter.
The first two parameters have both soft and hard limits (or, simply, barriers and limits). The
hard limit is the limit that cannot be exceeded under any circumstances. The soft limit can be
exceeded up to the hard limit, but as soon as the grace period expires, the additional disk space
or inodes allocations will fail. Barriers and limits are separated by colons (“:”) in Virtual Private
Server configuration files and in the command line.
The following session sets the disk space available to Virtual Private Server 101 to
approximately 1Gb and allows the VPS to allocate up to 90,000 inodes. The grace period for the
quotas is set to ten minutes:
# vzctl set 101 --diskspace 1000000:1100000 --save
Saved parameters for VPS 101
# vzctl set 101 --diskinodes 90000:91000 --save
Saved parameters for VPS 101
# vzctl set 101 --quotatime 600 --save
Saved parameters for VPS 101
# vzctl exec 101 df
Filesystem 1k-blocks Used Available Use% Mounted on
simfs 1000000 747066 252934 75% /
# vzctl exec 101 stat -f /
File: "/"
ID: 0 Namelen: 255 Type: ext2/ext3
Blocks: Total: 1000000 Free: 252934 Available: 252934 Size: 1024
Inodes: Total: 90000 Free: 9594
It is possible to change the first-level disk quota parameters for a running Virtual Private Server.
The changes will take effect immediately. If you do not want your changes to persist till the next
Virtual Private Server startup, do not use the
–-save
switch.