GIT & Jenkins
[Gitlab]Server 용량부족 확인 (feat. yum clean all)
johye0
2022. 2. 17. 08:39
반응형
GitLab이 가끔씩 500 Error를 표시할 때면 서버에 접속해서 메모리가 모두 차지는 않았는지 확인해본다.
지난번 쓰지도 않는 프로메테우스 데이터 때문에 데이터 정리를 했던 기억이 있어서
메모리 용량이 가장 큰 곳으로 찾아 들어가보니 /var/cache/yum/x86_64/7 경로였고, 구글링을 해보니 yum캐시때문이라고 한다.
아래 명령어를 실행 해 캐시를 삭제해준다. (106G 삭제!)
$ yum clean all
<용량 확인 및 명령어 실행>
[root@GitJenkins opt]# cd /var/
[root@GitJenkins var]# du -h --max-depth=1 | sort -hr
168G .
106G ./cache
56G ./opt
6.2G ./log
306M ./lib
4.8M ./spool
56K ./tmp
20K ./db
12K ./target
12K ./kerberos
8.0K ./empty
4.0K ./yp
4.0K ./preserve
4.0K ./nis
4.0K ./local
4.0K ./gopher
4.0K ./games
4.0K ./crash
4.0K ./adm
4.0K ./account
4.0K ./VRTSat_lhc
[root@GitJenkins var]# cd cache/
[root@GitJenkins cache]# ls
PackageKit abrt-di coolkey cups gdm ibus krb5rcache ldconfig libvirt man realmd yum
[root@GitJenkins cache]# du -h --max-depth=1 | sort -hr
106G ./yum
106G .
3.0M ./man
116K ./ibus
76K ./ldconfig
20K ./libvirt
16K ./cups
16K ./PackageKit
4.0K ./realmd
4.0K ./krb5rcache
4.0K ./gdm
4.0K ./coolkey
4.0K ./abrt-di
[root@GitJenkins cache]# cd yum
[root@GitJenkins yum]# du -h --max-depth=1 | sort -hr
106G ./x86_64
106G .
[root@GitJenkins yum]# cd x86_64/
[root@GitJenkins x86_64]# ls
7
[root@GitJenkins x86_64]# du -h --max-depth=1 | sort -hr
106G ./7
106G .
[root@GitJenkins x86_64]# ls -al
합계 12
drwxr-xr-x. 3 root root 4096 4월 21 2020 .
drwxr-xr-x. 3 root root 4096 4월 21 2020 ..
drwxr-xr-x. 13 root root 4096 2월 16 06:17 7
[root@GitJenkins x86_64]# cd 7
[root@GitJenkins 7]# ls
WANdisco-git base epel-apache-maven extras gitlab_gitlab-ee gitlab_gitlab-ee-source nodesource runner_gitlab-runner runner_gitlab-runner-source timedhosts timedhosts.txt updates yarn
[root@GitJenkins 7]#
[root@GitJenkins 7]#
[root@GitJenkins 7]#
[root@GitJenkins 7]#
[root@GitJenkins 7]# pwd
/var/cache/yum/x86_64/7
[root@GitJenkins 7]# du -h --max-depth=1 | sort -hr
106G .
92G ./gitlab_gitlab-ee
6.2G ./runner_gitlab-runner
5.8G ./updates
1.4G ./base
189M ./nodesource
12M ./WANdisco-git
7.0M ./yarn
1.6M ./extras
100K ./runner_gitlab-runner-source
100K ./gitlab_gitlab-ee-source
80K ./epel-apache-maven
[root@GitJenkins 7]# ^C
[root@GitJenkins 7]# ^C
[root@GitJenkins 7]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: WANdisco-git base epel-apache-maven extras gitlab_gitlab-ee gitlab_gitlab-ee-source nodesource runner_gitlab-runner runner_gitlab-runner-source updates yarn
Cleaning up list of fastest mirrors
Other repos take up 288 k of disk space (use --verbose for details)
[root@GitJenkins 7]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 12K 16G 1% /dev/shm
tmpfs 16G 756M 15G 5% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda4 197G 72G 116G 39% /
/dev/sda2 976M 143M 766M 16% /boot
/dev/sda3 640G 91G 518G 15% /home
/dev/sda1 1022M 12M 1011M 2% /boot/efi
tmpfs 3.1G 4.0K 3.1G 1% /run/user/42
tmpfs 3.1G 48K 3.1G 1% /run/user/1000
tmpfs 3.1G 44K 3.1G 1% /run/user/0
반응형