Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run disk quota excess check #2226

Closed
dilshat opened this issue Jan 30, 2018 · 7 comments
Closed

Run disk quota excess check #2226

dilshat opened this issue Jan 30, 2018 · 7 comments
Assignees
Labels
Milestone

Comments

@dilshat
Copy link
Member

dilshat commented Jan 30, 2018

We need to run checks if containers exceed their disk quotas and:

  1. Notify Hub about this if usage is close to 90%
  2. Stop container if limit is exceeded by factor 1.5

See https://github.com/subutai-io/agent/wiki/Switch-to-Soft-Quota

@dilshat dilshat self-assigned this Jan 30, 2018
@dilshat dilshat added this to the 6.3.5 milestone Jan 30, 2018
@dilshat
Copy link
Member Author

dilshat commented Jan 30, 2018

Hint:

obtain subdirs usage: du --max-depth=1 -B1 /var/snap/subutai-sysnet/common/lxc/Container1-jkz-1-4/

obtain container's total usage: du -s -B1 /var/snap/subutai-sysnet/common/lxc/Container1-jkz-1-4/

obtain all containers' usage (need to exclude non containers): du --max-depth=1 -B1 /var/snap/subutai-sysnet/common/lxc/

@happyaron
Copy link

happyaron commented Jan 30, 2018

Talked with @lbthomsen and we both agree that using du directly may hurt performance badly, so that as a trade-off we can use btrfs API to get the space usage, using accuracy to trade performance.

Also we are able to do more frequent statistics when using the btrfs API, to make sure the container does not fill up disk space quickly between our long check intervals.

lth@ncpws04:~$ sudo btrfs filesystem df /var/snap/subutai-master/common/lxc/ubuntu16/
Data, single: total=2.01GiB, used=543.50MiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=1.00GiB, used=48.19MiB
GlobalReserve, single: total=16.00MiB, used=0.00B

@dilshat
Copy link
Member Author

dilshat commented Jan 30, 2018

Good hint. Yes better use btrfs api

@dilshat
Copy link
Member Author

dilshat commented Jan 31, 2018

these commands show somewhat near values:

root@localhost:~# /snap/subutai-sysnet/current/bin/btrfs filesystem du -s /var/snap/subutai-sysnet/common/lxc/Container1-elb-2-6/ 
     Total   Exclusive  Set shared  Filename
 184.15MiB   828.00KiB   183.34MiB  /var/snap/subutai-sysnet/common/lxc/Container1-elb-2-6/


root@localhost:~# du -sh /var/snap/subutai-sysnet/common/lxc/Container1-elb-2-6
219M    /var/snap/subutai-sysnet/common/lxc/Container1-elb-2-6

whereas btrfs filesystem df has different output:

root@localhost:~# /snap/subutai-sysnet/current/bin/btrfs filesystem df /var/snap/subutai-sysnet/common/lxc/Container1-elb-2-6/
Data, single: total=5.01GiB, used=4.63GiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=1.50GiB, used=757.92MiB

@dilshat
Copy link
Member Author

dilshat commented Feb 1, 2018

@dilshat
Copy link
Member Author

dilshat commented Feb 1, 2018

@dilshat
Copy link
Member Author

dilshat commented Feb 1, 2018

dilshat pushed a commit that referenced this issue Feb 1, 2018
dilshat pushed a commit that referenced this issue Feb 2, 2018
@dilshat dilshat mentioned this issue Feb 5, 2018
dilshat pushed a commit that referenced this issue Feb 6, 2018
#2226 added pause between disk scans to decrease stress in RH
@dilshat dilshat mentioned this issue Feb 6, 2018
dilshat pushed a commit that referenced this issue Feb 6, 2018
dilshat pushed a commit that referenced this issue Feb 6, 2018
dilshat pushed a commit that referenced this issue Feb 6, 2018
dilshat pushed a commit that referenced this issue Feb 6, 2018
dilshat pushed a commit that referenced this issue Feb 6, 2018
dilshat pushed a commit that referenced this issue Feb 7, 2018
dilshat pushed a commit that referenced this issue Feb 7, 2018
#2226 skip stopped containers, added logs
@dilshat dilshat mentioned this issue Feb 7, 2018
@dilshat dilshat closed this as completed Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants