swap file vs swap partition

Jerry McAllister jerrymc at msu.edu
Mon Feb 5 15:57:50 UTC 2007

On Sun, Feb 04, 2007 at 03:24:39PM -0800, Aloha Guy wrote:

> What I actually meant was, I know in the old days, if you had 128MB, you 
> want a 256MB swap but with 2GB RAM, isn't 4GB going to be overkill for a 
> swap or are you saying that a 2GB swap will work?  I'm still lost on the 
> ratio since I thought the 2x was only if you had like small amounts of RAM.

It really depends on what you are doing with the system.  
The system also pages to swap space.  Now, you really want enough
ram so that you are not depending on paging while something is
running, but if you have lots of processes with many kind of resting
until something comes up, the system may gradually use up their
in-core space for other stuff, even though the process is not 
actually swapped out.   Then, if some of those processes have to
run again, they don't half to be built up again.   The system just
pulls back in the pages it needs - not necessarily the whole thing.
It is, then good to have enough space for that.   It would take 
some observation on how your system is used to decide just how
important your swap size is.   If you are running a big enough
system that 4 GB of ram is needed, then 4 GB or even 8 GB swap 
is not so comparatively large.   You would probably be running
disk sizes in 70-160 GB size and maybe more than one, so what's 4 GB!

Anyway, you want to have enough swap to cover a crash-dump - not
that it is a frequent occurance unless you are doing development.
After all, this is FreeBSD, not MS.  But, still, it is good to have.


ps.  Please learn to break your text lines at about 70 characters.
     It makes responding much easier.

> John
> ----- Original Message ----
> From: Scott Long <scottl at samsco.org>
> To: Aloha Guy <alohaguy123 at yahoo.com>
> Cc: questions at freebsd.org; current at freebsd.org
> Sent: Sunday, February 4, 2007 2:28:47 PM
> Subject: Re: swap file vs swap partition
> Aloha Guy wrote:
> > Thanks for the input.  You do have good points.  The only issue with 
> > swap partitions is that it seems like you need to increase it everytime 
> > you increase the physical memory.  Is there a swap partition size limit 
> > that pretty much will handle anything and setting a number larger than 
> > that will really not offer anything?
> >  
> > John
> Processors and memory have vastly outpaced the speed of disks; any
> amount of swapping is going to be percieved as being very slow and
> something that should be avoided.  Since RAM is also very cheap now,
> most people just load enough RAM into their system to handle their load,
> and then configure enough swap to hold a crashdump of that RAM.  You
> always want swap so that you can handle unexpected spikes in load
> without crashing, but it's less of an integral piece of normal system
> operation these days.
> Scott
> ____________________________________________________________________________________
> It's here! Your new message!  
> Get new email alerts with the free Yahoo! Toolbar.
> http://tools.search.yahoo.com/toolbar/features/mail/
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

More information about the freebsd-questions mailing list