2 votes

L'instance EC2 ubuntu est pleine mais je ne trouve pas pourquoi

Voici l'utilisation actuelle

Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M   11M   89M  11% /run
/dev/xvda1      7.7G  7.7G  396K 100% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/1000

Vous trouverez ci-dessous les résultats de du -ah . | sort -rh | head -20 dans les dossiers respectifs :

/utilisateur :

223M  .
179M  ./.composer/cache/repo/https---packagist.org
179M  ./.composer/cache/repo
179M  ./.composer/cache
179M  ./.composer
44M ./git/myapp
44M ./git
20M ./git/myapp/.git
19M ./git/myapp/.git/objects
16M ./git/myapp/.git/objects/pack/pack-906b417ebaebc4922a90397b82f180cdd8f59570.pack
16M ./git/myapp/.git/objects/pack
14M ./git/myapp/marc-v2-backend.zip
6.9M  ./git/myapp/public
5.0M  ./.composer/cache/repo/https---packagist.org/provider-illuminate$view.json
5.0M  ./.composer/cache/repo/https---packagist.org/provider-illuminate$validation.json
5.0M  ./.composer/cache/repo/https---packagist.org/provider-illuminate$support.json
5.0M  ./.composer/cache/repo/https---packagist.org/provider-illuminate$session.json
5.0M  ./.composer/cache/repo/https---packagist.org/provider-illuminate$routing.json
5.0M  ./.composer/cache/repo/https---packagist.org/provider-illuminate$queue.json
5.0M  ./.composer/cache/repo/https---packagist.org/provider-illuminate$mail.json

/var :

287M  ./lib
272M  ./www/html/myapp
272M  ./www/html
272M  ./www
172M  ./www/html/myapp/node_modules
152M  ./lib/apt/lists
152M  ./lib/apt
124M  ./cache
116M  ./cache/apt
115M  ./lib/dpkg
114M  ./lib/dpkg/info
66M ./www/html/myapp/vendor
40M ./lib/apt/lists/ap-southeast-1.ec2.archive.ubuntu.com_ubuntu_dists_xenial_universe_binary-amd64_Packages
35M ./lib/apt/lists/ap-southeast-1.ec2.archive.ubuntu.com_ubuntu_dists_xenial_universe_source_Sources
31M ./cache/apt/srcpkgcache.bin
31M ./cache/apt/pkgcache.bin
28M ./cache/apt/pkgcache.bin.PysQE6
27M ./cache/apt/archives
23M ./lib/apt/lists/ap-southeast-1.ec2.archive.ubuntu.com_ubuntu_dists_xenial_universe_i18n_Translation-en

J'ai essayé de courir dans / mais n'avait plus de place pour les journaux.

Il y a un fichier Swap de 1 Go :

              total        used        free      shared  buff/cache   available
Mem:           990M        121M         88M         22M        781M        624M
Swap:          1.0G        101M        922M

Qu'est-ce qui pourrait causer le gonflement de 6 Go ?

4voto

resting Points 341

La majeure partie de l'utilisation a été faite dans /usr/src .

Apparemment, il y avait beaucoup de fichiers d'en-tête linux, soit 3 Go !

J'ai fait ce qui suit :

sudo apt-get update
sudo apt-get -f install (cause there were some unmet dependencies)
sudo apt-get autoremove

ubuntu@:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-aws-headers-4.4.0-1022 linux-aws-headers-4.4.0-1039 linux-aws-headers-4.4.0-1041 linux-aws-headers-4.4.0-1043
  linux-aws-headers-4.4.0-1044 linux-aws-headers-4.4.0-1048 linux-aws-headers-4.4.0-1049 linux-aws-headers-4.4.0-1052
  linux-aws-headers-4.4.0-1054 linux-aws-headers-4.4.0-1055 linux-aws-headers-4.4.0-1057 linux-aws-headers-4.4.0-1060
  linux-aws-headers-4.4.0-1061 linux-aws-headers-4.4.0-1062 linux-aws-headers-4.4.0-1065 linux-aws-headers-4.4.0-1066
  linux-aws-headers-4.4.0-1069 linux-aws-headers-4.4.0-1070 linux-aws-headers-4.4.0-1072 linux-aws-headers-4.4.0-1074
  linux-aws-headers-4.4.0-1075 linux-aws-headers-4.4.0-1077 linux-aws-headers-4.4.0-1079 linux-aws-headers-4.4.0-1083
  linux-headers-4.4.0-1022-aws linux-headers-4.4.0-1039-aws linux-headers-4.4.0-1041-aws linux-headers-4.4.0-1043-aws
  linux-headers-4.4.0-1044-aws linux-headers-4.4.0-1048-aws linux-headers-4.4.0-1049-aws linux-headers-4.4.0-1052-aws
  linux-headers-4.4.0-1054-aws linux-headers-4.4.0-1055-aws linux-headers-4.4.0-1057-aws linux-headers-4.4.0-1060-aws
  linux-headers-4.4.0-1061-aws linux-headers-4.4.0-1062-aws linux-headers-4.4.0-1065-aws linux-headers-4.4.0-1066-aws
  linux-headers-4.4.0-1069-aws linux-headers-4.4.0-1070-aws linux-headers-4.4.0-1072-aws linux-headers-4.4.0-1074-aws
  linux-headers-4.4.0-1075-aws linux-headers-4.4.0-1077-aws linux-headers-4.4.0-1079-aws linux-headers-4.4.0-1083-aws
  linux-image-4.4.0-1022-aws linux-image-4.4.0-1039-aws linux-image-4.4.0-1041-aws linux-image-4.4.0-1043-aws
  linux-image-4.4.0-1044-aws linux-image-4.4.0-1048-aws linux-image-4.4.0-1049-aws linux-image-4.4.0-1052-aws
  linux-image-4.4.0-1054-aws linux-image-4.4.0-1055-aws linux-image-4.4.0-1057-aws linux-image-4.4.0-1060-aws
  linux-image-4.4.0-1061-aws linux-image-4.4.0-1062-aws linux-image-4.4.0-1065-aws linux-image-4.4.0-1066-aws
  linux-image-4.4.0-1069-aws linux-image-4.4.0-1070-aws linux-image-4.4.0-1072-aws linux-image-4.4.0-1074-aws
  linux-image-4.4.0-1075-aws linux-image-4.4.0-1077-aws linux-image-4.4.0-1079-aws linux-image-4.4.0-1083-aws
  linux-modules-4.4.0-1077-aws linux-modules-4.4.0-1079-aws linux-modules-4.4.0-1083-aws
0 upgraded, 0 newly installed, 75 to remove and 205 not upgraded.
After this operation, 3214 MB disk space will be freed.

Après avoir supprimé ces fichiers d'en-tête, l'utilisation est descendue à 3,3 Go. Avec 1 Go de swap, cela représente environ 2 Go de fichiers divers, ce qui me semble tout à fait raisonnable.

Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M   11M   89M  11% /run
/dev/xvda1      7.7G  3.3G  4.5G  42% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/1000

SistemesEz.com

SystemesEZ est une communauté de sysadmins où vous pouvez résoudre vos problèmes et vos doutes. Vous pouvez consulter les questions des autres sysadmins, poser vos propres questions ou résoudre celles des autres.

Powered by:

X