linux – 高内存64位服务器,不使用所有内存

linux – 高内存64位服务器,不使用所有内存,第1张

概述我有几个运行centos 64bit的高内存 Linux服务器,经过10-20天的正常运行时间,我注意到所有这些服务器上他们实际上并没有使用所有可用的ram(它们在48gb系统上都有大约10gb空闲,并且在64gb系统上免费20gb. 它们是Web服务器,并且在服务器中具有超过ram数量的工作数据集(例如活动文件),因此我假设页面缓存将增长到使用所有ram然后页面缓存中的页面将会在需要时被释放. 我有几个运行centos 64bit的高内存 Linux服务器,经过10-20天的正常运行时间,我注意到所有这些服务器上他们实际上并没有使用所有可用的ram(它们在48gb系统上都有大约10gb空闲,并且在64gb系统上免费20gb.

它们是Web服务器,并且在服务器中具有超过ram数量的工作数据集(例如活动文件),因此我假设页面缓存将增长到使用所有ram然后页面缓存中的页面将会在需要时被释放.

例如 :

top - 09:44:46 up 57 days,9:32,5 users,load average: 6.44,6.33,6.27Tasks: 680 total,4 running,676 sleePing,0 stopped,0 zombIEcpu(s): 17.3%us,3.3%sy,0.0%ni,79.0%ID,0.1%wa,0.0%hi,0.3%si,0.0%stMem:  49313212k total,39277524k used,10035688k free,1247064k buffersSwap: 20643832k total,0k used,20643832k free,20592968k cached

显示此服务器已启动57天,但是有10GB的ram free应该在页面缓存中使用.

以下sysctl是从库存中心设置的:

net.ipv6.conf.all.disable_ipv6 = 1net.ipv6.conf.default.disable_ipv6 = 1net.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 1net.ipv4.conf.default.accept_source_route = 0kernel.sysrq = 0kernel.core_uses_pID = 1net.ipv4.tcp_syncookies = 1kernel.msgmnb = 65536kernel.msgmax = 65536kernel.shmmax = 68719476736kernel.shmall = 4294967296net.ipv4.icmp_echo_ignore_broadcasts = 1net.ipv4.icmp_ignore_bogus_error_responses = 1net.ipv4.conf.all.accept_redirects = 0net.ipv6.conf.all.accept_redirects = 0net.ipv4.conf.all.secure_redirects = 1net.ipv4.conf.all.send_redirects = 0net.ipv4.conf.all.accept_source_route = 0net.ipv6.conf.all.accept_source_route = 0net.ipv4.conf.all.log_martians = 1error: "kernel.maps_protect" is an unkNown keynet.core.rmem_default = 8388608net.core.wmem_default = 8388608net.ipv4.tcp_rmem = 4096 87380 16777216net.ipv4.tcp_wmem = 4096 65536 16777216net.core.rmem_max = 16777216net.core.wmem_max = 16777216net.ipv4.tcp_max_syn_backlog = 4096net.core.netdev_max_backlog = 20000vm.min_free_kbytes = 85536net.ipv4.tcp_tw_recycle = 0net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_max_syn_backlog = 6000net.ipv4.tcp_fin_timeout = 10net.ipv4.tcp_fin_timeout = 40net.ipv4.tcp_keepalive_time = 1000net.ipv4.tcp_keepalive_probes = 2net.ipv4.tcp_keepalive_intvl = 30net.netfilter.nf_conntrack_tcp_timeout_established = 2000net.ipv4.tcp_tw_recycle = 0net.ipv4.tcp_tw_reuse = 1kernel.panic = 40fs.proc_can_see_other_uID = 0net.ipv4.ipfrag_secret_interval = 6000net.ipv4.tcp_max_tw_buckets = 1440000net.ipv4.tcp_max_tw_buckets_ub = 720000net.core.optmem_max = 25165824fs.proc_can_see_other_uID = 0fs.proc_super_gID = 32010vm.swappiness = 2fs.@R_419_6852@-max = 400000fs.suID_dumpable = 1kernel.msgmni = 1024kernel.sem = 250 256000 32 1024

iv尝试改变现在一对多的sysctl!希望有些善良的人可能已经看过这个,提前感谢任何帮助.

解决方法 我回到这里回答我自己的问题!

当你有多个cpu(而不是多核),例如每个带有x核的2个cpu,就会引起这个问题

vm.zone_reclaim_mode = 0

解决这个问题.

总结

以上是内存溢出为你收集整理的linux – 高内存64位服务器,不使用所有内存全部内容,希望文章能够帮你解决linux – 高内存64位服务器,不使用所有内存所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1036100.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存