Wow, thank you Gena! That clears things up. Now it's time to write a
check for open files and figure this out...
Thanks,
Chris
On 11/01/2016 05:11 PM, Gena Makhomed wrote:
On 01.11.2016 22:52, Chris James wrote:
It doesn't seem to do anything if the container is running:
It works with running containers too.
pcompact do nothing if threshold is not exceeded.
/etc/vz/pcompact.conf
# Start compacting if unused space is greater than specified THRESHOLD
in percent to ploop size
THRESHOLD=10
[root@sovereign ~]# du -sch /vz/private/101/root.hdd/
114G /vz/private/101/root.hdd/
[root@sovereign ~]# vzctl exec 101 df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/ploop42957p1 277G 101G 162G 39% /
[root@sovereign ~]# /usr/sbin/pcompact
...
Inspect 5120cb33-6817-4888-bd9a-fdbfa87b913e
Inspect /vz/private/101/root.hdd/DiskDescriptor.xml
Disk: /vz/private/101/root.hdd/DiskDescriptor.xml
ploop=288000MB image=115754MB data=108013MB balloon=0MB
Rate: 2.7 (threshold=10)
image=115754MB (114G)
data=108013MB (101G)
Rate: 2.7 (threshold=10)
[root@sovereign ~]# du -sch /vz/private/101/root.hdd/
114G /vz/private/101/root.hdd/
[root@sovereign ~]# vzctl exec 101 df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/ploop42957p1 277G 101G 162G 39% /
[root@sovereign ~]# vzctl stop 101
!!! you have used 101G inside container.
after stop container - free space is changed to 57G
threshold is exceeded, and pcompact start to work.
[root@sovereign ~]# /usr/sbin/pcompact
...
pass4 group:2224 Relocated inodes:0, local:0 extents: 0, blocks 0
Starting relocation
Opening delta /vz/private/101/root.hdd/root.hds
TRUNCATED: 116 cluster-blocks (121634816 bytes)
...
< tons of output >
[root@sovereign ~]# vzctl start 101
[root@sovereign ~]# du -sch /vz/private/101/root.hdd/
76G /vz/private/101/root.hdd/
[root@sovereign ~]# vzctl exec 101 df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/ploop42957p1 277G 57G 207G 22% /
So I guess my question is am I expect to /stop/ and compact my
containers regularly?
You have 44G *DELETED* *OPEN* files inside contaier.
This is not normal situation.
If you can't prevent such deleted but still open files -
you have only one way: restart containers (by cron?)
and run pcompact by cron after restarting containers.
Better way - prevent deleted but still open files
inside your containers, and use pcompact on running containers.
P.S.
Try to set THRESHOLD=1 in /etc/vz/pcompact.conf for better compacting.
_______________________________________________
Users mailing list
Users@openvz.org
https://lists.openvz.org/mailman/listinfo/users