Date: Tue, 14 Aug 2012 01:45:14 -0700 From: Colin Percival <cperciva@freebsd.org> To: Peter Jeremy <peter@rulingia.com> Cc: FreeBSD current <freebsd-current@freebsd.org> Subject: Re: Time to bump default VM_SWZONE_SIZE_MAX? Message-ID: <502A101A.7050909@freebsd.org> In-Reply-To: <20120813212309.GA74129@server.rulingia.com> References: <502831B7.1080309@freebsd.org> <20120813212309.GA74129@server.rulingia.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 08/13/12 14:23, Peter Jeremy wrote: > On 2012-Aug-12 15:44:07 -0700, Colin Percival <cperciva@freebsd.org> > wrote: >> If I'm understanding things correctly, the "maxswzone" value -- set by >> the kern.maxswzone loader tunable or to VM_SWZONE_SIZE_MAX by default -- >> should be approximately 9 MiB per GiB of swap space. > > I'm not sure how you got that value. By default, struct swblock is 288 > bytes (280 bytes on 32-bit archs) and can store up to 32 pages of swap (the > comment in vm/swap_pager.c:swap_pager_swap_init() is wrong). For x86, this > is 2.25 MiB per GiB (best case). I got that value from a previous mailing list discussion -- I think it was based on the (incorrect) value of 16 pages per swblock and not exceeding 50% swblock utilization. > Realistically, I'd say that the default VM_SWZONE_SIZE_MAX can handle about > 9GB swap (at least, that was my experience). The 50% utilization rule of thumb would make it 7 GB, but yes, same order of magnitude. > BTW, if you plan on allocating lots of swap, be aware that each swap device > is limited to 32GiB - see vm/swap_pager.c:swaponsomething(). Yes, noted. I'm not actually using lots of swap myself, but I was writing code for EC2 instances to set up "reasonable" amounts of swap at boot time, and I don't want to accidentally autoconfigure more swap than FreeBSD can safely use. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?502A101A.7050909>