From owner-freebsd-questions Tue May 2 16:32:59 2000 Delivered-To: freebsd-questions@freebsd.org Received: from atlas.bit.net.au (atlas.bit.net.au [203.18.94.3]) by hub.freebsd.org (Postfix) with ESMTP id 68C3E37BB51 for ; Tue, 2 May 2000 16:32:54 -0700 (PDT) (envelope-from pdh@atlas.bit.net.au) Received: (from pdh@localhost) by atlas.bit.net.au (8.9.3/8.9.3/Debian/GNU) id JAA01590 for freebsd-questions@FreeBSD.ORG; Wed, 3 May 2000 09:32:51 +1000 Date: Wed, 3 May 2000 09:32:50 +1000 From: Phil Homewood To: freebsd-questions@FreeBSD.ORG Subject: Re: BSD Theology: swap, /var, /tmp and /usr/tmp Message-ID: <20000503093249.A22805@atlas.bit.net.au> References: <390F41FD.5880279E@telinco.net> <20000503012329.A3265@student.csd.uu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20000503012329.A3265@student.csd.uu.se>; from ertr1013@student.csd.uu.se on Wed, May 03, 2000 at 01:23:29AM +0200 X-PGP-Key-ID: 1024/EDE1CCB5 1996/02/26 X-PGP-Fingerprint: 86 B5 37 9D 5B ED EC BB 7C 0D B5 D6 C2 45 13 F1 X-PGP-Public-Key-Finger: phil@rivendell.apana.org.au X-PGP-Public-Key-URL: http://rivendell.apana.org.au/~phil/pgp.asc Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Erik Trulsson wrote: > The idea behind the 2*memory rule is basically that if you need to use more > memory than twice your physical memory the system will have such lousy > performance due to all the swapping that you really want more RAM. My understanding was as follows: * Suppose you have N Mb of RAM. Assume that N is relatively large such that kernel footprint and minimal necessary processes occupy negligible fraction of N. * Suppose you have a process P which needs to use around N Mb of RAM. Suppose that all RAM is in use. (ie, worst case for swapping.) If you have less than 2*N swap, you do not have enough room to swap out everything else in the N Mb of RAM to swap in (and out) the N Mb image required by process P in one hit, so you need to do it in smaller chunks, which thrashes the disk. If you have > 2*N Mb of swap (plus any required for other swapped out processes) then you can swap the image of P in and out with minimal overhead. Is this correct? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message