Server Swapping

Nifty Hat Mitch mitch48 at sbcglobal.net
Mon Oct 18 20:31:24 UTC 2004


On Sat, Oct 16, 2004 at 09:58:37PM +0100, James Wilkinson wrote:

> Mallia Cedric wrote:
> > I just realised that one of our servers (with 1G of RAM) has no swap
> > enabled. Can anyone help as to how I can enable swap without
> > reformatting or reinstalling ?
> 
> Gene Heskett replied:
> > However, if the partition scheme you setup doesn't include a swap 
> > partition, then it may be best to get another small drive and shut it 
> > down long enough to install it as /dev/hdc or /dev/hdd, keeping it 
> > off the same cable the main drive is on.  Then fdisk it to setup 
> > enough of it as swap, some as /var and the rest as a backup storage 
> > area like I did.  Put it in the /etc/fstab, and do the swapon.  
> > Another 2 to 3GB should be enough, and as its on a seperate drive, it 
> > will be faster than thrashing the main drive.
> 
> This is good advice when setting up a new server.
> 
> However, given that the server has apparently been running for some time
> with no swap at all, I suspect that this is overkill: the swap will be
> little more than a fallback position.

Recall that swap to files is also supported.
Since the file is fully allocated on disk there is
no dynamic impact on files system space.

It is possible to have multiple swap files.
Start out smallish  and add another later as  needed.
Swap priorities can order them if you wish to have
a preference for one files system over another.

Of interest top has a non default field that can be selected....  

  SWAP = Swapped size (kb)

You can dump a top listing with this field set and do some arithmetic
to see what the upper size guesstimate for swapping of your healthy
working set of processes is.  i.e. you can see how close to the edge 
different changes might put you.  Compare RSS/SWAP/SHR....

Application authors might explore memory mapping files in contrast to
reading file data into memory.  There can be a data swap footprint
difference... if the data is durable (applications crash).


-- 
	T o m  M i t c h e l l 
	May your cup runneth over with goodness and mercy
	and may your buffers never overflow.




More information about the fedora-list mailing list