Re: OT (slightly) swap limits



On Sat, Apr 26, 2008 at 05:13:28PM -0600, Bob Proulx wrote:

For an enterprise quality server where reliability matters I fully
agree. Yes. You want twice your ram. But you also want to set
vm.overcommit_memory=2 for reliability.

By default Linux will overcommit memory allocation. The malloc(3)
library can't fail. The fork(2) system call can't fail. But this
means that if there isn't enough memory in the future that Linux may
need to kill something. That works similarly to a 'kill -9', the
process simply stops running. There is no ability of the process to
log the event to a log file. It just disappears.


Now after learning about this I always disable overcommit. This
restores a traditional Unix process model. Programs that call for
memory (through the malloc() interface or fork(), program level
interfaces that use memory) will see failures if there isn't enough
memory. This is a Good Thing as it allows applications to handle
issues and log them generally deal with the problem.

Summary: So in my mind an Important Aspect of system configuration is
Reliability and in order to get Reliability it is needed to turn off
Linux kernel memory overcommit in order to avoid the dreaded and often
misguided OOM Killer. This is the important point but it affects the
amount of virtual memory required by a system and that in turn affects
the need for having swap space configured. With overcommit turned off
then the rule for twice the amount of RAM is again required. (In
other words you don't need swap / VM configured equal to twice RAM if
vm.overcommit_memory=0 as is the Linux default. But then you must
deal with the OOM killer behavior.)

[ Sidebar: This is how you disable overcommit on a system. This can
be done temporarily with the following command.

sudo sysctl -w vm.overcommit_memory=2


Since debian is supposed to be trying to be reliable (while still being
useable for almost anything), I wonder why this isn't the debian default
(with appropriate documentation as to why, the need for more swap than
other distros, and how to revert back to Linux default if needed)?

Doug.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: determining speed using window xp
    ... With exactly the same processor you are saying the memory speed is twice as ... RAM is random access memory. ... Drives are ...
    (microsoft.public.windowsxp.basics)
  • Re: Snow Leopard 64-bit Rumor Mongering!
    ... The main thing for 64-bit is the memory. ... are twice as big is nice too, but it is a small thing compared to the ... So they can do 4 GB + 5 K fine, but there's still a limit on total physical RAM that's not far off. ... Be warned that if you actually do push the VM system over its limits, it may crash: many Unixes handle memory exhaustion poorly, and I rather expect OS X is one of them. ...
    (comp.sys.mac.advocacy)
  • Re: Real cost of the mini
    ... memory and twice as much ram you will ever need. ... is a serious memory hog that realistically needs 1GB, ... Selling the mini with only 256mb ram would be like selling PC's ... 256 MB of RAM - IF you have a real video card with its own RAM. ...
    (comp.sys.mac.advocacy)
  • Re: Real cost of the mini
    ... memory and twice as much ram you will ever need. ... is a serious memory hog that realistically needs 1GB, ... Selling the mini with only 256mb ram would be like selling PC's ... 256 MB of RAM - IF you have a real video card with its own RAM. ...
    (comp.sys.mac.advocacy)
  • Re: Real cost of the mini
    ... memory and twice as much ram you will ever need. ... is a serious memory hog that realistically needs 1GB, ... Selling the mini with only 256mb ram would be like selling PC's ... 256 MB of RAM - IF you have a real video card with its own RAM. ...
    (comp.sys.mac.advocacy)