SWAP size

Jin Guojun [DSD] j_guojun at lbl.gov
Wed Apr 30 17:36:13 PDT 2003


Jason Stone wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> > If you have a lot of memory and you are able to control all processes
> > not to overrun the system memory, 0.5 - 1x swap is OK;  you need some
> > swap space to back up yourself in case something happens. That is why
> > 2x is recommended; but not required if this is not a server.
> >
> > For server, 2x may be required, and typically 2.5x is needed.
>
> Also remember that crash-dumps get written to swap, so if you want to be
> able to take a dump in the event of a panic, you need at least as much
> swap as physical ram.
>
> Since crash-dumps are usually a good idea (or at least the ability to take
> a dump if your system starts acting strangely), I think you should never
> have less than 1x ram on a production system.
>
>  -Jason

In fact, becareful when enabling crash dump on a large RAM system,
which is very bad idea,  in recent practice.
I used a 1GB RAM system to do kernel development, when panic,
each KB takes 1-2 second to dump, and it also takes similar amout
of time to do the savecore when system is up.
crash dump on 1 GB memory system takes average 2000 second
to complete :-(

Recently, we upgraded all major systems to 4 GB RAM since RAM is cheap,
the crash dump will take 8000 second to complete according to 1GB dump rate.

So, this is the lesson we learnt to use only 64-128 MB RAM system to do
kernel development due to crash dump issue, since developing kernel
does not need a lot of memory. In this case, you do need a lot of swap since
RAM is small.

    -Jin



More information about the freebsd-performance mailing list