Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 1999 16:22:41 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        sthaug@nethelp.no
Cc:        rock@dead-end.net, freebsd-hackers@FreeBSD.ORG, tech-userlevel@netbsd.org
Subject:   Re: Swap overcommit (was Re: Replacement for grep(1) (part 2))
Message-ID:  <199907152322.QAA13667@apollo.backplane.com>
References:  <199907152237.PAA13341@apollo.backplane.com> <23932.932078808@verdi.nethelp.no>

next in thread | previous in thread | raw e-mail | index | archive | help
    Here is what I get from one of BEST's mail & www proxy machines.
    ~dillon/br adds the object size's together.  'swap' and 'default'
    objects refers to unbacked VM objects - and none of the processes running
    fork shared unbacked objects so we don't have to worry about that.  The 
    'swap' designation means that at least one page in the object has been
    assigned swap.  The default designation means that no pages have been 
    assigned swap.  The pages can be dirty or clean.

    Typical /proc/PID/map output looks like this (taken from one of the
    sendmail processes).  The lines I've marked are the ones being counted
    as unbacked/swap-backed VM.  The rest are vnode-backed and not counted.

0x1000     0x4b000           66         0 r-x COW vnode
0x4b000    0x4e000            3         3 rwx COW vnode
0x4e000    0x87000           53        43 rwx COW swap		<---
0x87000    0x373000         738       738 rwx     default	<---
0x2004b000 0x2005a000         2         0 r-x COW vnode
0x2005a000 0x2005c000         2         0 rwx COW vnode
0x2005c000 0x20065000         6         2 rwx COW swap		<---
0x20068000 0x2006d000         3         0 r-x COW vnode
0x2006d000 0x2006e000         1         1 rwx COW vnode
0x2006e000 0x200cc000        70         0 r-x COW vnode
0x200cc000 0x200d0000         4         4 rwx COW vnode
0x200d0000 0x200e7000         8         6 rwx COW swap		<---
0xefbde000 0xefbfe000        14        14 rwx COW swap		<---

    proxy1:/tmp# cat /proc/*/map | egrep 'swap|default' | ~dillon/br
    639168K

    proxy1:/tmp# pstat -s
    Device      1K-blocks     Used    Avail Capacity  Type
    /dev/sd0b      524288    12596   511628     2%    Interleaved

    This machine has 256MB of ram of which around 200MB is in use, we
    will assume the entire 200MB is used by VM spaces for processes.  It is 
    an active machine with around 205 processes at the time of the test.

    So.  200MB of ram + 12MB of swap = 212MB of actual storage being used
    out of 639MB of total swap-backable VM.

    About a factor of 3.2:1.  Actual swap utilization is sitting at 2%.
    If no overcommit were allowed, and assuming a VMSPACE = REALMEM + SWAP
    model, 200MB of ram would be active and 439MB worth of swap would be 
    either allocated or reserved ( though only 12MB would be actually written,
    that part doesn't change ).  439MB of swap verses 12MB of swap.

    In that scenario, the 512MB of swap I assigned to this machine would be
    dangerously low.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



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




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