默认情况下关闭Linux OOM杀手?

默认情况下关闭Linux OOM杀手?,第1张

概述Linux上的OOM杀手每隔一段时间就会对各种应用程序造成严重破坏,而且似乎在内核开发方面并没有做太多改进.作为设置新服务器时的最佳做法,将内存过度使用的默认设置反转,即将其关闭(vm.overcommit_memory = 2),除非您知道要将其用于特定用途,否则它会不会更好?那些用例是什么,你知道你想要过度使用? 作为奖励,因为在vm.overcommit_memory = 2的情况下的行为取 Linux上的OOM杀手每隔一段时间就会对各种应用程序造成严重破坏,而且似乎在内核开发方面并没有做太多改进.作为设置新服务器时的最佳做法,将内存过度使用的默认设置反转,即将其关闭(vm.overcommit_memory = 2),除非您知道要将其用于特定用途,否则它会不会更好?那些用例是什么,你知道你想要过度使用?

作为奖励,因为在vm.overcommit_memory = 2的情况下的行为取决于vm.overcommit_ratio和交换空间,对于后两者的大小调整以使整个设置保持合理运行将是一个很好的经验法则吗?

解决方法 一个有趣的比喻(从 http://lwn.net/Articles/104179/):

An aircraft company discovered that it was cheaper to fly its planes with less fuel on board. The planes would be lighter and use less fuel and money was saved. On rare occasions however the amount of fuel was insufficIEnt,and the plane would crash. This problem was solved by the engineers of the company by the development of a special OOF (out-of-fuel) mechanism. In emergency cases a passenger was selected and thrown out of the plane. (When necessary,the procedure was repeated.) A large body of theory was developed and many publications were deVoted to the problem of properly selecting the victim to be ejected. Should the victim be chosen at random? Or should one choose the heavIEst person? Or the oldest? Should passengers pay in order not to be ejected,so that the victim would be the poorest on board? And if for example the heavIEst person was chosen,should there be a special exception in case that was the pilot? Should first class passengers be exempted? Now that the OOF mechanism existed,it would be activated every Now and then,and eject passengers even when there was no fuel shortage. The engineers are still studying precisely how this malfunction is caused.

总结

以上是内存溢出为你收集整理的默认情况下关闭Linux OOM杀手?全部内容,希望文章能够帮你解决默认情况下关闭Linux OOM杀手?所遇到的程序开发问题。

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

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

原文地址: http://outofmemory.cn/yw/1045562.html

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

发表评论

登录后才能评论

评论列表(0条)

保存