[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] swap size



Personal experience:

When a Linux server runs out of physical RAM and virtual RAM (swap space),
running processes are randomly terminated "as needed".  The kernel
terminates ("reaps") these processes in an attempt to free enough memory to
continue functioning and avoid a crash -- sort of a self-preservation mode.

You can witness this behaviour by examining the kernel ring buffer (man
dmesg) after a process has suspiciously ended.  You will see messages
similar to:

VM: killing process httpd
VM: killing process mysqld
VM: killing process sendmail

That is a sure sign you were a tad lean when estimating physical RAM and
swap space requirements :-)

Personal opinion:

I have given up trying to find the one true and "correct" swap partition
size formula :-)  First, it's a moving target from kernel release to kernel
release.  Second, the formula must flex based on the available hardware as
RAM and disk space are either scarce or abundant.  And third, the amount
and type of software running on the system will dramatically (and often
unpredictably) impact overall RAM requirements.

The bottom line is you have to "get to know" the software that will be
running on the system primarily, and the level of demand for it, before you
can truly get a feel for memory requirements and tune the system's RAM and
swap space.

In the mean time, the old rule of thumb (2 X available RAM) will keep most
folks out of trouble :-)

--Kyle



>
> The rule of thumb for Red Hat Linux 7.1 and 7.2 comes from a part of
> the  Linux 2.4 kernel VM implementation (from 2.4.0 til about 2.4.12? I
>  think). There are a couple of cases where the kernel will aggressively
>  swap out all its memory plus anything that was already swapped out.
> This  would cause any box with less than 2x swap to lock hard. Some VM
> people  saw this as a feature for other reasons than this case.. but it
> hit  enough people that the kernel developers told RH to require no
> less than  2x memory. The later 2.4 kernels do not have this 'feature'
> and you can  probably get away with 1x swap space.
>
> For the K12LTSP 2.0.x boxes you will need at least 2x.. To answer the
> original question, you should be fine with 1024 Mb of swap. The old
> rule  of thumb was to have 2x-8x of swap because by the time you were
> using 8x  of your memory the box was probably in swap death and should
> be shut  down anyway.
>
> On Mon, 29 Apr 2002, John Meissen wrote:
>
>>
>>dbentson orion lcsd k12 wa us said:
>>> The documentation I have says that I should have my SWAP space be the
>>> same size as my available RAM. But during the install, I wasn't sure
>>> how much ram I had so I guessed at 512MB. As it turns out, I only
>>> have 256 MB. Should I make changes?
>>
>>I'd love to know where that rule of thumb came from. It's been
>>around for 20 years or more. In my opinion, it's completely wrong.
>>
>
>
> --
> Stephen John Smoogen
>  smooge mindspring com
>
>
>
> _______________________________________________
> K12OSN mailing list
> K12OSN redhat com
> https://listman.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]