Swap size

Kris Kennaway kris at obsecurity.org
Fri Aug 17 10:29:05 PDT 2007


On Fri, Aug 17, 2007 at 11:07:14AM -0400, Andy Greenwood wrote:

> My understanding was that you should estimate swap size based on the 
> sizes of the programs which might be paged out. However, when I first 
> set up my system, I didn't know this and created 1G swap slices (one on 
> each disk) but I am not convinced that this was the best thing to do, 
> since my system almost never uses a noticible percentage of the swap 
> space. right now, I've got
> 
> [andy at zeus fusefs-sshfs]$ swapinfo
> Device          1K-blocks     Used    Avail Capacity
> /dev/ad0s1b.eli   1048576     1148  1047428     0%
> /dev/ad1s1b.eli   1048576     1096  1047480     0%
> Total             2097152     2244  2094908     0%
> 
> And the system is under normal load. This system has 1G of RAM. Is there 
> any sense in having this much swap space when it's not being used?

swap is there to guard against overload conditions, not for normal
load.

If you are paging during normal operations your system performance
will be terrible, so you want to make sure you have enough RAM that
this does not happen.  However, when a transient load spike comes in,
would you prefer your system to slow down but keep working, or to kill
off all your processes?  Think of it as memory space insurance.

Kris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20070817/2a6c0fb1/attachment.pgp


More information about the freebsd-questions mailing list