.glusterfs folder is too big whereas my regular data is smaller - linux

I'm using glusterfs 7.8 across 3 nodes. Recently we are removed bunch of data which is takes approximately 170 GB from glusterfs volume. Now our regular data sits at 1.5 GB but there is a folder named .glusterfs which haves data 177.9 Gb in the glusterfs volume. And we are running out of disk space. What is it and how can i clean it?
$ gluster volume status vlys_vol:
Status of volume: vlys_vol
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick 192.168.1.42:/mnt/kubernetes/vlys_vol 49152 0 Y 1919
Brick 192.168.1.10:/mnt/kubernetes/vlys_vol 49152 0 Y 6702
Brick 192.168.1.37:/mnt/kubernetes/vlys_vol 49152 0 Y 1054
Self-heal Daemon on localhost N/A N/A Y 1126
Self-heal Daemon on 192.168.1.10 N/A N/A Y 6714
Self-heal Daemon on ubuntu-vm1 N/A N/A Y 2021
Task Status of Volume vlys_vol
------------------------------------------------------------------------------
There are no active volume tasks
$ gluster volume status vlys_vol detail:
Status of volume: vlys_vol
------------------------------------------------------------------------------
Brick : Brick 192.168.1.42:/mnt/kubernetes/vlys_vol
TCP Port : 49152
RDMA Port : 0
Online : Y
Pid : 1919
File System : ext4
Device : /dev/vda2
Mount Options : rw,relatime,data=ordered
Inode Size : 256
Disk Space Free : 193.1GB
Total Disk Space : 617.6GB
Inode Count : 41156608
Free Inodes : 30755114
------------------------------------------------------------------------------
Brick : Brick 192.168.1.10:/mnt/kubernetes/vlys_vol
TCP Port : 49152
RDMA Port : 0
Online : Y
Pid : 6702
File System : ext4
Device : /dev/nvme0n1p2
Mount Options : rw,relatime,errors=remount-ro
Inode Size : 256
Disk Space Free : 220.7GB
Total Disk Space : 937.4GB
Inode Count : 62480384
Free Inodes : 58114459
------------------------------------------------------------------------------
Brick : Brick 192.168.1.37:/mnt/kubernetes/vlys_vol
TCP Port : 49152
RDMA Port : 0
Online : Y
Pid : 1054
File System : ext4
Device : /dev/vda2
Mount Options : rw,relatime
Inode Size : 256
Disk Space Free : 1.5TB
Total Disk Space : 2.0TB
Inode Count : 134217728
Free Inodes : 109614197
$ gluster peer status:
Number of Peers: 2
Hostname: ubuntu-vm1
Uuid: a4bc6a92-0505-4cbc-8811-e3c69714519b
State: Peer in Cluster (Connected)
Hostname: 192.168.1.37
Uuid: 01568855-feca-4e30-8ef3-8d626e0c8e6d
State: Peer in Cluster (Connected)
Here is the ncdu results:
--- /mnt/kubernetes/vlys_vol ------------------------------------------------------------
177,9 GiB [##########] /.glusterfs
1,5 GiB [ ] /vlys-test
706,8 MiB [ ] /vlys
40,0 KiB [ ] /data-redis-cluster-1
32,0 KiB [ ] /data-redis-cluster-4
32,0 KiB [ ] /data-redis-cluster-3
32,0 KiB [ ] /data-redis-cluster-2
32,0 KiB [ ] /data-redis-cluster-0
32,0 KiB [ ] /data-redis-cluster-5
24,0 KiB [ ] /vlys-test-sts-default
24,0 KiB [ ] /vlys-test-sts
e 8,0 KiB [ ] /data-redis-cluster-test-5
e 8,0 KiB [ ] /data-redis-cluster-test-4
e 8,0 KiB [ ] /data-redis-cluster-test-3
e 8,0 KiB [ ] /data-redis-cluster-test-2
e 8,0 KiB [ ] /data-redis-cluster-test-1
e 8,0 KiB [ ] /data-redis-cluster-test-0
--- /mnt/kubernetes/vlys_vol/.glusterfs -------------------------------------------------
/..
6,2 GiB [##########] /57
5,3 GiB [######## ] /22
4,6 GiB [####### ] /cd
4,5 GiB [####### ] /97
4,5 GiB [####### ] /e8
4,3 GiB [###### ] /a2
4,3 GiB [###### ] /c1
4,0 GiB [###### ] /88
3,9 GiB [###### ] /07
3,8 GiB [###### ] /66
3,7 GiB [##### ] /48
3,6 GiB [##### ] /8e
3,4 GiB [##### ] /15
3,4 GiB [##### ] /ee
3,3 GiB [##### ] /26
2,9 GiB [#### ] /aa
2,9 GiB [#### ] /52
2,9 GiB [#### ] /f3
(much more folders like this)
2,9 MiB [ ] /09
2,9 MiB [ ] /71
2,9 MiB [ ] /a4
2,8 MiB [ ] /4a
32,0 KiB [ ] /indices
e 20,0 KiB [ ] /unlink
12,0 KiB [ ] /changelogs
e 4,0 KiB [ ] /landfill
4,0 KiB [ ] health_check

Related

cgroup and process memory usage mismactch

I have a memory cgroup with 1 process in it.
And look for rss memory usage in that cgroup (in memory.stat) and it is much bigger than rss memory of the process (from /proc/[pid]/status).
The only process pid in cgroup:
$ cat /sys/fs/cgroup/memory/karim/master/cgroup.procs
3744924
The memory limit in cgroup:
$ cat /sys/fs/cgroup/memory/karim/master/memory.limit_in_bytes
7340032000
rss of the cgroup is 990 MB:
$ cat /sys/fs/cgroup/memory/karim/master/memory.stat
cache 5990449152
rss 990224384
rss_huge 0
shmem 0
mapped_file 13516800
dirty 1081344
writeback 270336
pgpgin 4195191
pgpgout 2490628
pgfault 5264589
pgmajfault 0
inactive_anon 0
active_anon 990240768
inactive_file 5862830080
active_file 127021056
unevictable 0
hierarchical_memory_limit 7340032000
total_cache 5990449152
total_rss 990224384
total_rss_huge 0
total_shmem 0
total_mapped_file 13516800
total_dirty 1081344
total_writeback 270336
total_pgpgin 4195191
total_pgpgout 2490628
total_pgfault 5264589
total_pgmajfault 0
total_inactive_anon 0
total_active_anon 990240768
total_inactive_file 5862830080
total_active_file 127021056
total_unevictable 0
rss of the process is 165 MB:
$ cat /proc/3744924/status
Name: [main] /h
Umask: 0002
State: S (sleeping)
Tgid: 3744924
Ngid: 0
Pid: 3744924
PPid: 3744912
TracerPid: 0
Uid: 1000 1000 1000 1000
Gid: 1001 1001 1001 1001
FDSize: 256
Groups: 1000 1001
NStgid: 3744924
NSpid: 3744924
NSpgid: 3744912
NSsid: 45028
VmPeak: 2149068 kB
VmSize: 2088876 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 245352 kB
VmRSS: 198964 kB
RssAnon: 165248 kB
RssFile: 33660 kB
RssShmem: 56 kB
VmData: 575400 kB
VmStk: 132 kB
VmExe: 3048 kB
VmLib: 19180 kB
VmPTE: 1152 kB
VmSwap: 0 kB
HugetlbPages: 0 kB
CoreDumping: 0
THP_enabled: 1
Threads: 17
SigQ: 0/241014
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000001001000
SigCgt: 0000000180000002
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000003fffffffff
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp: 0
Speculation_Store_Bypass: thread vulnerable
Cpus_allowed: fff
Cpus_allowed_list: 0-11
Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 94902
nonvoluntary_ctxt_switches: 1903
Why is there such a big difference?

linux - df command says disk 100% used, but it actually it's not

I have an EC2 instance running jenkins service and almost everyday it stops working saying the disk is full.
So I enter the instance to check and it really says 100% used
$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 987M 60K 987M 1% /dev
tmpfs 997M 0 997M 0% /dev/shm
/dev/xvda1 32G 32G 0 100% /
So I use NCDU to check what is occuping the space and it says only 8gb is used.
ncdu 1.10 ~ Use the arrow keys to navigate, press ? for help
--- / -------------------------------------------------------
3.7GiB [##########] /var
1.7GiB [#### ] /home
1.6GiB [#### ] /usr
1.0GiB [## ] swapfile
323.6MiB [ ] /opt
133.8MiB [ ] /lib
47.3MiB [ ] /boot
43.8MiB [ ] /root
23.1MiB [ ] /public
19.8MiB [ ] /lib64
12.3MiB [ ] /sbin
10.7MiB [ ] /etc
7.0MiB [ ] /bin
3.7MiB [ ] /tmp
60.0KiB [ ] /dev
e 16.0KiB [ ] /lost+found
16.0KiB [ ] /.gnupg
12.0KiB [ ] /run
e 4.0KiB [ ] /srv
e 4.0KiB [ ] /selinux
e 4.0KiB [ ] /mnt
e 4.0KiB [ ] /media
e 4.0KiB [ ] /local
e 4.0KiB [ ] /cgroup
. 0.0 B [ ] /proc
0.0 B [ ] /sys
0.0 B [ ] .autorelabel
0.0 B [ ] .autofsck
Total disk usage: 8.6GiB Apparent size: 8.6GiB Items: 379695
Then I reboot the instance and the free space comes back to only 28% used
$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 987M 60K 987M 1% /dev
tmpfs 997M 0 997M 0% /dev/shm
/dev/xvda1 32G 8.7G 23G 28% /
What can be causing this problem?
Additional data:
PSTREE
init─┬─acpid
├─agetty
├─amazon-ssm-agen───6*[{amazon-ssm-agen}]
├─atd
├─auditd───{auditd}
├─crond
├─dbus-daemon
├─2*[dhclient]
├─java─┬─sh───sudo───gulp --prod───9*[{gulp --prod}]
│ └─67*[{java}]
├─lvmetad
├─lvmpolld
├─6*[mingetty]
├─rngd
├─rpc.statd
├─rpcbind
├─rsyslogd───3*[{rsyslogd}]
├─2*[sendmail]
├─sshd───sshd───sshd───bash───pstree
├─supervisord───2*[php]
└─udevd───2*[udevd]
CRONTAB
* * * * * cd /home/ec2-user/laravel-prod && php artisan schedule:run >> /dev/null 2>&1
0 1 * * * rm /var/log/jenkins/jenkins.log

virtual memory size is much larger than RES, although there are no mapped files

The program has much large virtual memory than it's in ram, there is no swapping, since there is a lot of free space in ram. I looked at file descriptors, and there are no large files. This is part of process map:
107 00007f97f8021000 65404K ----- [ anon ]
108 00007f97fc000000 2052K rw--- [ anon ]
109 00007f97fc201000 63484K ----- [ anon ]
110 00007f9800000000 272K rw--- [ anon ]
111 00007f9800044000 65264K ----- [ anon ]
112 00007f98043fa000 4K ----- [ anon ]
113 00007f98043fb000 10240K rw--- [ anon ]
There are a lot of regions with about 64Kb. If they are allocated in my program, why then ram is only 250mb and virtual 3gb? What means anon?

Valgrind support for TMS320DM365

We have developed an application using ipnc_rdk version 5.0 for TMS320DM365 .
We have memory leak in the application.
We cross compiled valgrind for arm using arm- arago.
But when we run valgrind on the device, it shows illegal instruction error.
We saw couple of posts telling that valgrind doesn't support armv5.
We got valgrind patches for armv5 at below link, but they fail to apply in the valgrind source.
https://bugs.kde.org/show_bug.cgi?id=248998
We tried applying patches for valgrind 3.9.0 3.8.1 & 3.2.1 versions
Is there a valgrind version for armv5 ?
If not how can we debug memory leak error in our application.
Also i ran top utility to check memory usage and there was increase in memory. Also kerenel calls oom killer. Please find the attached log which gives the top utility output and also the out of memory log
Top utility output just before oom killer was called:
shrd, 8K buff, 8352K cached
CPU: 86% usr 13% sys 0% nic 0% idle 0% io 0% irq 0% sirq
Load average: 2.86 1.31 0.51 4/54 690
PID PPID USER STAT VSZ %MEM %CPU COMMAND
663 655 root R 59184 132% 97% /opt/ipnc/stillImage.out
668 655 root R 3080 7% 3% top
1 0 root S 1624 4% 0% init [5]
269 2 root SW 0 0% 0% [kswapd0]
627 1 root S 6152 14% 0% ./boa -c /etc
655 1 root S 3080 7% 0% -sh
529 1 root S 2976 7% 0% /usr/sbin/inetd
651 1 root S 2964 7% 0% /sbin/syslogd -n -C64 -m 20
653 1 root S 2900 6% 0% /sbin/klogd -n
646 1 root S 2900 6% 0% /usr/sbin/telnetd
634 1 root S 2704 6% 0% avahi-daemon: running [10.local]
637 1 root S 1940 4% 0% /usr/sbin/avahi-dnsconfd -D
630 1 root S 1764 4% 0% avahi-autoipd: [eth0] bound 169.254.11
631 630 root S 1764 4% 0% avahi-autoipd: [eth0] callout dispatch
622 2 root SW 0 0% 0% [flush-1:0]
620 2 root SW 0 0% 0% [flush-ubifs_0_0]
5 2 root SW 0 0% 0% [kworker/u:0]
4 2 root SW 0 0% 0% [kworker/0:0]
3 2 root SW 0 0% 0% [ksoftirqd/0]
2 0 root SW 0 0% 0% [kthreadd]
stillImage.out invoked oom-killer: gfp_mask=0x200da, order=0, oom_adj=0, oom_score_adj=0
[ 96.003955] Backtrace:
[ 96.006595] Function entered at [<c0030504>] from [<c03330c8>]
[ 96.012605] r7:00000042 r6:00000000 r5:000200da r4:c1f06000
[ 96.018703] Function entered at [<c03330b0>] from [<c007cad0>]
[ 96.024712] Function entered at [<c007ca58>] from [<c007cf50>]
[ 96.030710] Function entered at [<c007cf00>] from [<c007d478>]
[ 96.036727] Function entered at [<c007d1b4>] from [<c00809bc>]
[ 96.042602] Function entered at [<c008056c>] from [<c007a5d0>]
[ 96.048656] Function entered at [<c007a574>] from [<c0132024>]
[ 96.054670] Function entered at [<c0131fb8>] from [<c00794bc>]
[ 96.060669] Function entered at [<c00793cc>] from [<c007b6c8>]
[ 96.066683] Function entered at [<c007b220>] from [<c007b78c>]
[ 96.072694] Function entered at [<c007b718>] from [<c01317a8>]
[ 96.078718] Function entered at [<c0131620>] from [<c00a2b34>]
[ 96.084813] Function entered at [<c00a2a90>] from [<c00a35e8>]
[ 96.090777] r8:400b4000 r7:c1f07f70 r6:400b4000 r5:00001000 r4:c1d85680
[ 96.098026] Function entered at [<c00a3534>] from [<c00a3738>]
[ 96.103955] r8:400b4000 r7:00001000 r6:c1d85680 r5:00000000 r4:0004e000
[ 96.111222] Function entered at [<c00a36f4>] from [<c002d020>]
[ 96.117225] r8:c002d1a4 r7:00000004 r6:00351d08 r5:400b4000 r4:00001000
[ 96.124460] Mem-info:
[ 96.126777] DMA per-cpu:
[ 96.129412] CPU 0: hi: 6, btch: 1 usd: 4
[ 96.134472] active_anon:2952 inactive_anon:179 isolated_anon:0
[ 96.134504] active_file:95 inactive_file:192 isolated_file:0
[ 96.134531] unevictable:0 dirty:191 writeback:0 unstable:0
[ 96.134557] free:220 slab_reclaimable:86 slab_unreclaimable:437
[ 96.134584] mapped:154 shmem:1911 pagetables:71 bounce:0
[ 96.163348] DMA free:880kB min:880kB low:1100kB high:1320kB active_anon:11808kBinactive_anon:716kB active_file:380kB inactive_file:768kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:48768kB mlocked:0kB dirty:764kB writeback:0kB mapped:616kB shmem:7644kB slab_reclaimable:344kB slab_unreclaimable:1748kB kernel_stack:432kB pagetables:284kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:1760 all_unreclaimable? yes
[ 96.202321] lowmem_reserve[]: 0 0 0
[ 96.206059] DMA: 6*4kB 7*8kB 8*16kB 1*32kB 4*64kB 3*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 880kB
[ 96.216739] 2198 total pagecache pages
[ 96.224107] 12288 pages of RAM
[ 96.227313] 317 free pages
[ 96.230128] 1096 reserved pages
[ 96.233410] 389 slab pages
[ 96.236289] 187 pages shared
[ 96.239319] 0 pages swap cached
[ 96.242494] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[ 96.250121] [ 529] 0 529 744 20 0 0 0 inetd
[ 96.257877] [ 627] 0 627 1538 22 0 0 0 boa
[ 96.265408] [ 630] 0 630 441 20 0 0 0 avahi-autoipd
[ 96.273789] [ 631] 0 631 441 15 0 0 0 avahi-autoipd
[ 96.282186] [ 634] 0 634 676 54 0 0 0 avahi-daemon
[ 96.290549] [ 637] 0 637 485 22 0 0 0 avahi-dnsconfd
[ 96.299030] [ 646] 0 646 725 15 0 0 0 telnetd
[ 96.306996] [ 651] 0 651 741 34 0 0 0 syslogd
[ 96.314876] [ 653] 0 653 725 22 0 0 0 klogd
[ 96.322563] [ 655] 0 655 770 29 0 0 0 sh
[ 96.330018] [ 663] 0 663 14796 1080 0 0 0 stillImage.out
[ 96.338552] [ 668] 0 668 770 54 0 0 0 top
[ 96.346062] Out of memory: Kill process 663 (stillImage.out) score 66 or sacrifice child
[ 96.354411] Killed process 663 (stillImage.out) total-vm:59184kB, anon-rss:3824kB, file-rss:496kB
Thanks and Regards,
Arpitha

VmSize = physical memory + swap?

I have a little question regarding VmSize, in the documentation it's supposed to be the application's usage of memory.
However on my system:
VmSize = physical memory + swap
VmHWM seems more like what the application actually would be using.
[root#sun ~]# free -m
total used free shared buffers cached
Mem: 12012 9223 2788 0 613 1175
-/+ buffers/cache: 7434 4577
Swap: 3967 0 3967
[root#sun ~]# cat /proc/8268/status
Name: mysqld
State: S (sleeping)
Tgid: 8268
Pid: 8268
PPid: 1
TracerPid: 0
Uid: 89 89 89 89
Gid: 89 89 89 89
FDSize: 512
Groups: 89
VmPeak: 15878128 kB
VmSize: 15878128 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 7036312 kB
VmRSS: 7036312 kB
VmData: 15839272 kB
VmStk: 136 kB
VmExe: 10744 kB
VmLib: 6356 kB
VmPTE: 16208 kB
VmSwap: 0 kB
Threads: 265
SigQ: 0/96048
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000087007
SigIgn: 0000000000001000
SigCgt: 00000001800066e9
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000001fffffffff
Seccomp: 0
Cpus_allowed: fff
Cpus_allowed_list: 0-11
Mems_allowed: 00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 2567
nonvoluntary_ctxt_switches: 77
Any idea of why?
I try to get the usage of memory for this application in particular but this result doesn't really make sense.
Thanks.
VMsize is the "address space" that the process has in use: the number of available adresses. These addresses do not have to have any physical memory attached to them. (Attached physical memory is the RSS figure)
You can verify this by allocating a chunk of memory with p = malloc(4 * 1024 * 1024);, and not doing anything to *p: the VmSize will increase by 1K pages, but the RSS will be (about) the same. (your program will have more adressable memory, but it does not address it, so the memory does not need to be attached )
VmSize is the sum of all mapped memory (/proc/pid/maps)

Resources