> On 2016-11-27 06:27, Jeffrey 'jf' Lim wrote:
> For some time now, my opinion has been to not use any swap at all for
> any of my systems. Maybe I'm extreme, but when my systems fail, I want
> them to fail categorically so that I know that something is wrong (I'm
> assuming that there's something similar to the OOM killer on Linux)
> instead of "not fail but grind along slowly". Am I wrong to think this
> way?

Well, maybe not extreme, but it certainly depends on the use case and
needs. Linux is the only OS in the family that is using memory
overcommitment by default. It means, that Linux is fairly optimistic
when assigning memory to the process in a way, that is assumes that
process won't actually need to address all of it while running. This,
of course, is rather shortsighted and it ended up with developing OOM
killer -- which is at current stage fair from ideal. (Though maybe
recent changes will make it better [1]). UNIX systems are not lying to
the processes they are running -- if they have memory, they will make
it available and if not -- they won't. Simple.

Long story short, removing swap will not make system "fail
categorically" -- if the system in mind is Linux, you just need to
adjust overcommitment settings -- it can be done in a way, that will
make it behave like a normal UNIX systems out there in the wild [2].
Otherwise, swap is just part of the virtual memory -- while you may
not necessary need it on your laptop, it can certainly prove useful
when you run out of RAM on your production MySQL server.

If you are more into Solaris-way of handling memory, this one [3]
proved fairly handy on couple occasion.

[1] - https://lwn.net/Articles/668126/#reaper
[2] - https://www.kernel.org/doc/Documentation/sysctl/vm.txt
[3] - https://www.princeton.edu/~unix/Solaris/troubleshoot/SolarisMemory.pdf

Best
 - Filip


-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com

Reply via email to