Kev*_*Kev 3 linux memory centos virtual-memory
我有几台运行 centos 64bit 的高内存 linux 服务器,在正常运行 10-20 天后,我注意到在所有这些服务器上,它们实际上并没有使用到那时可用的所有内存(它们在 48gb 系统上都有大约 10gb 的空闲空间,并且在 64gb 系统上免费 20gb。
它们是网络服务器,并且在服务器中有超过 ram 数量的工作数据集(例如活动文件),所以我假设页面缓存会增长到使用所有 ram 的程度,然后页面缓存中的页面会在需要时/如果需要被释放。
例如 :
top - 09:44:46 up 57 days, 9:32, 5 users, load average: 6.44, 6.33, 6.27
Tasks: 680 total, 4 running, 676 sleeping, 0 stopped, 0 zombie
Cpu(s): 17.3%us, 3.3%sy, 0.0%ni, 79.0%id, 0.1%wa, 0.0%hi, 0.3%si, 0.0%st
Mem: 49313212k total, 39277524k used, 10035688k free, 1247064k buffers
Swap: 20643832k total, 0k used, 20643832k free, 20592968k cached
Run Code Online (Sandbox Code Playgroud)
显示该服务器已经运行了 57 天,但是有 10GB 的空闲内存应该用于页面缓存。
以下 sysctl 是从库存 centos 设置的:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv4.conf.all.log_martians = 1
error: "kernel.maps_protect" is an unknown key
net.core.rmem_default = 8388608
net.core.wmem_default = 8388608
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_max_syn_backlog = 4096
net.core.netdev_max_backlog = 20000
vm.min_free_kbytes = 85536
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_syn_backlog = 6000
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_fin_timeout = 40
net.ipv4.tcp_keepalive_time = 1000
net.ipv4.tcp_keepalive_probes = 2
net.ipv4.tcp_keepalive_intvl = 30
net.netfilter.nf_conntrack_tcp_timeout_established = 2000
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
kernel.panic = 40
fs.proc_can_see_other_uid = 0
net.ipv4.ipfrag_secret_interval = 6000
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.tcp_max_tw_buckets_ub = 720000
net.core.optmem_max = 25165824
fs.proc_can_see_other_uid = 0
fs.proc_super_gid = 32010
vm.swappiness = 2
fs.file-max = 400000
fs.suid_dumpable = 1
kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024
Run Code Online (Sandbox Code Playgroud)
iv 尝试将一个或多个 sysctl 更改为现在!,并希望有好心人之前可能已经看到过,在此先感谢您的帮助。
小智 6
我回到这里来回答我自己的问题!
当您有多个 CPU(不是多核)例如 2 个 CPU,每个 CPU 具有 x 个内核时,就会导致该问题
vm.zone_reclaim_mode=0
解决了这个问题。
| 归档时间: |
|
| 查看次数: |
1455 次 |
| 最近记录: |