Launcher cleanup having opposite effect?


(Casey Locker) #1

I’m curious as to what’s going on here. To me it looks like the ./launcher cleanup process is having the opposite effect when comparing the before and after Usage of /: measurements as well as the -1900608 statement.
I’m sure I’m missing something obvious.

System load:  0.07               Processes:              200
  Usage of /:   34.5% of 29.40GB   Users logged in:        0
  Memory usage: 7%                 IP address for eth0:    xxx.xxx.xxx.xxx
  Swap usage:   0%                 IP address for docker0: xxx.xxx.xxx.xxx

/var/discourse# ./launcher cleanup

The following command will
- Delete all docker images for old containers
- Delete all stopped and orphan containers

Are you sure (Y/n): y
Starting Cleanup

Deleted: cd94895da6cd554a18a90891d264693dd9e556a821bf594b572ebfa4d04cfb2d
Deleted: c1f3dbda760cba96c5efc94554c3ebed5025f7e2a7d0a7a757b65bc31eb2780e
Deleted: 2fdb7b2c0c6a531374e9e9d3236dd67f6d11f17fb9b8083692f6f14bbd4d50b1
13527736
15428344
./launcher cleanup cleared up -1900608 of disk space.
root@myserver:/var/discourse# 
root@myserver:/var/discourse# exit
logout
Connection to discourse.myserver.com closed.
My-MacBook-Pro:~ me$ ssh root@discourse.myserver.com
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-40-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Fri May 22 11:25:56 EDT 2015

  System load:  0.04               Processes:              195
  Usage of /:   50.7% of 29.40GB   Users logged in:        0
  Memory usage: 8%                 IP address for eth0:    xxx.xxx.xxx.xxx
  Swap usage:   0%                 IP address for docker0: xxx.xxx.xxx.xxx

(Jeff Atwood) #2

Looks like it works to me…

root@discourse:~# df -m
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/vda1          40188 22184     15941  59% /
none                   1     0         1   0% /sys/fs/cgroup
udev                 991     1       991   1% /dev
tmpfs                201     1       200   1% /run
none                   5     0         5   0% /run/lock
none                1001     1      1001   1% /run/shm
none                 100     0       100   0% /run/user

root@discourse:/var/discourse# ./launcher cleanup

The following command will
- Delete all docker images for old containers
- Delete all stopped and orphan containers

Are you sure (Y/n):

Starting Cleanup
Deleted: 2cc056b92694093e9886d31653772ebca25d592f2348878c02dcec0d593e1a5c
Deleted: b91c81703b5ccb1d73014a409c2612fb76e5aa44251eb6fb2af8dadf2ec6fb1b
Deleted: c51f13c7a92087ae0258f29fb26c6f89f33f0e25c6060ec870bfbecae4a45475
Deleted: 397cd11ef765b120a042d74fc90b4fdcf11350485565b18c4e5b455de6a6a735
Deleted: bb4aa1057ff0ea80746169b5f53a03250717505b5cbc792756454718f52791c0
Deleted: 4e6337565dd56b3db2ab07ffa06296d00b58ac4298ff3ced53cdfeeb7a188090
Deleted: c9e61dbb7e0dbdb603f031c786271d22a8533208e2dab6abeed90068d31e47f1
16322880
20797168
./launcher cleanup cleared up -4474288 of disk space.

root@discourse:/var/discourse# df -m
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/vda1          40188 17814     20310  47% /
none                   1     0         1   0% /sys/fs/cgroup
udev                 991     1       991   1% /dev
tmpfs                201     1       200   1% /run
none                   5     0         5   0% /run/lock
none                1001     1      1001   1% /run/shm
none                 100     0       100   0% /run/user

Notice the difference in the df -m output.

But the output is definitely weird since it is negative…


(Casey Locker) #3

That makes sense. I was just concerned about the reported “34.5%” versus “50.7%” used before/after of the system drive. FWIW, without having done anything to the server since posting, the system reports “Usage of /: 38.3% of 29.40GB” currently. Sounds like it’s a linux or Ubuntu specific issue. Maybe garbage collection process.


(Sam Saffron) #4

that reporting is really buggy we got to fix it, math in bash is hard


(flyabroad) #5

I use the last docker source, when run cleanup to free disk, I Got a operand expected (error token is "- ") syntax error.

or How to manually delete unused docker images. Dose this safe?

docker rm docker ps -a | grep Exited | awk '{print $1 }'
docker rmi docker images -aq


./launcher cleanup

The following command will

  • Delete all docker images for old containers
  • Delete all stopped and orphan containers

Are you sure (Y/n): Y

Starting Cleanup (bytes free 2590616)

date: invalid date ‘"2015-09-29 09:52:3’

scripts/docker-gc: line 69: 1443524202 - : syntax error: operand expected (error token is "- ")

Finished Cleanup (bytes free 2590588)


(Jeff Atwood) #6

Did you do git pull first? The cleanup script was updated in the last month or so.


(Sam Saffron) #7

This is a known issue, I need to start running cleanup in a lightweight container, it depends on a recentish version of bash