分享知识,分享快乐

0%

cdh85-42 内存分析 cache 占用过高 434G 改后 变为 384G

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

[root@cdh85-42 ~]# free -h
total used free shared buff/cache available
Mem: 502G 34G 1.5G 4.2G 467G 461G
Swap: 4.0G 0B 4.0G
[root@cdh85-42 ~]#
[root@cdh85-42 ~]#
[root@cdh85-42 ~]# cat /proc/meminfo
MemTotal: 527318720 kB
MemFree: 1513916 kB
MemAvailable: 483579148 kB
Buffers: 28 kB
Cached: 472560904 kB
SwapCached: 0 kB
Active: 249755248 kB
Inactive: 254111684 kB
Active(anon): 25622464 kB
Inactive(anon): 10038512 kB
Active(file): 224132784 kB
Inactive(file): 244073172 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 4194300 kB
SwapFree: 4194300 kB
Dirty: 2216 kB
Writeback: 64 kB
AnonPages: 31309320 kB
Mapped: 113004 kB
Shmem: 4352956 kB
Slab: 17466532 kB
SReclaimable: 15190848 kB
SUnreclaim: 2275684 kB
KernelStack: 38048 kB
PageTables: 574580 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 267853660 kB
Committed_AS: 313602836 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 1170752 kB
VmallocChunk: 34089979900 kB
HardwareCorrupted: 0 kB
AnonHugePages: 6144 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 372288 kB
DirectMap2M: 32319488 kB
DirectMap1G: 505413632 kB
[root@cdh85-42 ~]#

https://fivezh.github.io/2017/06/18/centos-7-memory-available/

https://blog.csdn.net/starshine/article/details/7434942

centos 6 7 linux 初始化脚本

https://blog.51cto.com/12445535/2362407

min_free_kbytes 调整 为 50G

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

cat /proc/sys/vm/min_free_kbytes
cat /etc/sysctl.conf # add vm.min_free_kbytes = 52428800
sysctl -p
cat /proc/sys/vm/min_free_kbytes




[root@cdh85-42 ~]# vim /etc/sysctl.conf
## add
vm.min_free_kbytes = 52428800
## add


[root@cdh85-42 ~]# cat /proc/sys/vm/min_free_kbytes
90112

[root@cdh85-42 ~]# sysctl -p

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 10000 65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
fs.file-max = 655350
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_synack_retries = 1
net.core.netdev_max_backlog = 16384
net.ipv4.tcp_max_orphans = 16384
net.ipv4.tcp_fin_timeout = 2
net.core.somaxconn = 32768
kernel.threads-max = 196605
kernel.pid_max = 196605
vm.max_map_count = 393210
vm.swappiness = 0
vm.min_free_kbytes = 52428800


[root@cdh85-42 ~]#
[root@cdh85-42 ~]#
[root@cdh85-42 ~]# free -m
total used free shared buff/cache available
Mem: 514959 34901 82648 4258 397410 324618
Swap: 4095 0 4095
[root@cdh85-42 ~]# cat /proc/sys/vm/min_free_kbytes
52428800