From owner-freebsd-questions@FreeBSD.ORG Tue Nov 1 16:10:37 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 228A816A41F for ; Tue, 1 Nov 2005 16:10:37 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail23.sea5.speakeasy.net (mail23.sea5.speakeasy.net [69.17.117.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8111E43D5E for ; Tue, 1 Nov 2005 16:10:36 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 24300 invoked from network); 1 Nov 2005 16:10:35 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail23.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 1 Nov 2005 16:10:35 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id 2D81B2841D; Tue, 1 Nov 2005 11:10:35 -0500 (EST) Sender: lowell@be-well.ilk.org To: Bob Johnson References: <6.2.3.4.2.20051101094812.030e2d20@pop.msdi.ca> <54db43990511010750m3ecb0702se3de2eafaaa9a7c5@mail.gmail.com> From: Lowell Gilbert Date: 01 Nov 2005 11:10:35 -0500 In-Reply-To: <54db43990511010750m3ecb0702se3de2eafaaa9a7c5@mail.gmail.com> Message-ID: <44r7a09wn8.fsf@be-well.ilk.org> Lines: 63 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org, Ian Lord Subject: Re: Swap space 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: Tue, 01 Nov 2005 16:10:37 -0000 Bob Johnson writes: > On 11/1/05, Ian Lord wrote: > > Hi, > > > > I just bought 4 servers with 4 gigs of ram, the documentation > > proposes to use 2 to 3 times the amount of ram for swap... I don't > > think 12 gigs of swap would be useful lol, but do I really need to > > put 4 gigs of ram. (It might be useful for kernel dump but...) > > > > That's the original reason for the suggestion. You need more than > twice the amount of RAM if you need to capture a dump for debugging. > If you won't ever be doing that, you may not need so much swap. Not quite: >From dumpon(8) on 5-STABLE: For most systems the size of the specified dump device must be at least the size of physical memory. Even though an additional header is added to the dump, the BIOS for a platform typically holds back some memory, so it is not usually necessary to size the dump device larger than the actual amount of RAM available in the machine. > My experience is that if you have much more than twice the RAM size > swapped out, things start to get so sluggish that it is better to find > a way to reduce your memory requirement or provide more physical > memory. Of course, that is characteristic of MY usage and may not > apply at all to your usage, but it may be the reason that 3xRAM is the > upper limit of what is routinely recommended. Interactive single-user use will probably act like that nearly all the time. High page fault rates will always slow the system down. It's not necessary the case that a system will maintain high paging rates when it's gone deep into swap, but the exceptions are rather special cases. > > What do you guys do with swap space in this scenario ? > > Provide what you think you will need. It depends on what you expect > to be doing with your memory. A busy mail server that will be using > huge amounts of temporary storage to manipulate the messages may not > need a lot of swap, simply because you might prefer to throttle > incoming mail when the system gets heavily loaded rather than get deep > into swap and slow the system down. That's an interesting example, but it's still just an example; it won't necessarily apply to all mail servers, especially configurations that use a lot of short-lived files. The basic advice is quite sound, so I'll reiterate it: Provide what you think you might ever need. If in doubt, err on the side of caution. > I configured my new 4GB servers with 4GB of swap. That's more than I > expect to ever need, but I have oodles of disk space. If you have > multiple drives, you may want to spread that out among the drives for > more efficiency (but to do a dump you need enough contiguous space on > one drive). For ordinary desktop or server use, I think it's always a good idea to have enough swap for a kernel dump. It's cheap insurance.