Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 1999 16:05:39 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        "Matthew D. Fuller" <fullermd@futuresouth.com>
Cc:        "Childers, Richard" <RCHILDER@hamquist.com>, "'H. Eckert '" <ripley@nostromo.in-berlin.de>, "'freebsd-security@FreeBSD.ORG '" <freebsd-security@FreeBSD.ORG>
Subject:   Re: 4 Swap partitions limit (was  Re: RE: Little question (offtopic))
Message-ID:  <199908102305.QAA71254@apollo.backplane.com>
References:  <D57D3E9BF7C1D211884400805F77AC7DFE384B@sf1-mail01> <199908102243.PAA70944@apollo.backplane.com> <19990810175550.A2750@futuresouth.com>

next in thread | previous in thread | raw e-mail | index | archive | help

:>     You can compile up a kernel that allows more then four, but even
:>     having four will almost certainly going to be overkill.
:
:How so?

    Your example below is a case in point, though I don't know the uptime
    on your box.  What is the use of having lots of swap partitions which
    never get used?  You are just wasting a significant amount of kernel
    memory to hold the management structures, especially if the swap 
    parittions are not balanced. 

    Yours are not.  Even if you set NSWAP to exactly 5 the rlist (under
    STABLE) that the kernel allocates to manage swap allocation in your
    configuration is going to be massively fragmented.  Under CURRENT the
    bitmap radix tree will also eat significantly more memory then it 
    really needs to.  

    But STABLE is going to be the worst off.  With the rlist that fragmented,
    if you ever use more then around 130MB x 5 = 500MB of swap space (out of
    the 2G you have allocated), swapin operations will begin to degrade due
    to the scanning overhead on the rlist.

    I recommend reducing the swap on da0s1b to 512MB and removing the swap
    partitions on da2s1b and da3s1b which are too small to be usefull and
    cause unnecessary fragmentation, and leaving NSWAP at its default 4.
    This will cut kernel memory overhead in half and still leave you with
    1.5GB of swap.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

:I have 5 on my personal workstation, and will probably have more whenever
:I add disk.  I generally stick a swap partition on every physical disk
:(things like news spool drives are excepted for obvious reasons).
:
:Vis:
:[17:45:29] mortis:~
:(ttyp8):{6}% pstat -s
:Device      1024-blocks     Used    Avail Capacity  Type
:/dev/da0s1b      655232        0   655232     0%    Interleaved
:/dev/da1s1b      524160        0   524160     0%    Interleaved
:/dev/da2s1b      130944        0   130944     0%    Interleaved
:/dev/da3s1b      262016        0   262016     0%    Interleaved
:/dev/da4s1b      524160        0   524160     0%    Interleaved
:Total           2096512        0  2096512     0%
:
:(I just rebooted, normally anywhere from 50-200 megs is used under normal
:conditions).
:
:-- 
:Matthew Fuller     (MF4839)     |    fullermd@over-yonder.net
:Unix Systems Administrator      |    fullermd@futuresouth.com
:Specializing in FreeBSD         |    http://www.over-yonder.net/



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908102305.QAA71254>