Moving Container Files to the Cache Area
We will illustrate the effect produced by
# df /vz Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 13756796 1348292 11622123 11% /vz # pctl exec 101 df Filesystem 1K-blocks Used Available Use% Mounted on vzfs 1048576 22311 1026265 3% / # pctl exec 102 df Filesystem 1K-blocks Used Available Use% Mounted on vzfs 1048576 22311 1026265 3% / After that, we copy the dummy file, which is around 600 MB in size, to the root of these Containers: # cp foo /vz/root/101 # cp foo /vz/root/102 Now check the disk space once again: # df /vz Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 13756796 2569060 10401355 20% /vz # pctl exec 101 df Filesystem 1K-blocks Used Available Use% Mounted on vzfs 1048576 632430 416146 61% / # pctl exec 102 df Filesystem 1K-blocks Used Available Use% Mounted on vzfs 1048576 632430 416146 61% /
We see that around 600 MB has been added to the space occupied by each Container and, consequently, around 1.2 GB has been added to the space used on the
# vzcache -v 101 102 Processing VZFSv2 Container 101 VZFSv2 Container 101 78 regular files Processing VZFSv2 Container 102 VZFSv2 Container 102 78 regular files
During the command execution,
Let us now take the final look at the disk space usage: # df /vz Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 13756796 1953053 11017362 16% /vz # pctl exec 101 df Filesystem 1K-blocks Used Available Use% Mounted on vzfs 1048576 15105 1033471 2% / # pctl exec 102 df Filesystem 1K-blocks Used Available Use% Mounted on vzfs 1048576 15138 1033438 2% / As you can see, both the server and the Containers have each gained more than 600 MB of disk space. In real life, the disk space is gained by caching not one huge file in two Containers but a number of identical files across many Containers.
The operation of the
|
||||
|