From owner-freebsd-questions@FreeBSD.ORG Fri Aug 17 15:24:13 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E558D16A468 for ; Fri, 17 Aug 2007 15:24:13 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp3.utdallas.edu (smtp3.utdallas.edu [129.110.10.49]) by mx1.freebsd.org (Postfix) with ESMTP id B961513C45B for ; Fri, 17 Aug 2007 15:24:13 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from utd59514.utdallas.edu (utd59514.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTP id 4AE40654FF for ; Fri, 17 Aug 2007 10:24:13 -0500 (CDT) Date: Fri, 17 Aug 2007 10:24:09 -0500 From: Paul Schmehl To: freebsd-questions@freebsd.org Message-ID: In-Reply-To: <46C5B9A2.3020305@gmail.com> References: <098C8817-8D41-4D94-96E2-97D4310B0BAE@gmail.com> <20070817145551.GA27837@gizmo.acns.msu.edu> <46C5B9A2.3020305@gmail.com> X-Mailer: Mulberry/4.0.6 (Linux/x86) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=sha1; protocol="application/pkcs7-signature"; boundary="==========72B7346180118631194D==========" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Swap size X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Aug 2007 15:24:14 -0000 --==========72B7346180118631194D========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline --On Friday, August 17, 2007 11:07:14 -0400 Andy Greenwood=20 wrote: > Jerry McAllister wrote: >> On Fri, Aug 17, 2007 at 02:05:57AM +0200, Nicholas Wieland wrote: >> >> >>> I was reading tuning(7), and I found that I should size my swap >>> double the size of my physical memory. >>> AFAIK that was true some years ago, when memory was not as cheap as >>> now, and following that guideline I should set my swap to 2GB, which >>> seems far too much for swap (at least to me ...). I will never need >>> this much memory as 1GB RAM and 2GB swap. >>> Is it still correct ? How can I resize with bsdlabel if I already >>> used all my disk space during install ? >>> >> >> Remember, disk sizes have shot up too. >> No, 2 GB is not excessive. You can get by with less, but you're >> not likely to be using proportionately as much disk now as you used >> to by going with 2X - I aim for a little over 2X. >> >> Remember that swap gets used for crash dumps and also for paging. >> Now, you may think that you want to keep your machine from paging >> and in one sense that is true. If you are so memory bound that >> it has to page just to run, you're going to be so slow that it >> seems to have froze (by today's standards). But, the system does >> write stuff to page space and for processes that are often called >> it can speed things up. >> >> So, it is not really a waste to assign that much to swap. >> >> ////jerry >> >> >>> TIA, >>> ngw >>> >>> -- >>> Nicholas Wieland >>> nicholas.wieland@gmail.com >>> >>> >>> >>> _______________________________________________ >>> freebsd-questions@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >>> To unsubscribe, send any mail to >>> "freebsd-questions-unsubscribe@freebsd.org" >>> >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to >> "freebsd-questions-unsubscribe@freebsd.org" >> > 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@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? Yes. As was stated earlier, you will need that much space to save a core=20 file if the system crashes. If you don't care about troubleshooting major=20 system crashes, then don't worry about it. OTOH, disk sizes have grown so=20 large that 2GB of swap is negligible use of space. I always configure swap = to be 2xRAM plus 200MB. On a 300GB drive, that's less than 1% of the space = available. --=20 Paul Schmehl (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/ --==========72B7346180118631194D==========--