From owner-freebsd-questions@freebsd.org Mon Jan 21 08:24:05 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AB17149C353 for ; Mon, 21 Jan 2019 08:24:05 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (net-2-44-121-52.cust.vodafonedsl.it [2.44.121.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mailserver.netfence.it", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5369975030 for ; Mon, 21 Jan 2019 08:24:04 +0000 (UTC) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.local.netfence.it [10.1.2.18]) (authenticated bits=0) by soth.netfence.it (8.15.2/8.15.2) with ESMTPSA id x0L7u54T063207 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 21 Jan 2019 08:56:11 +0100 (CET) (envelope-from ml@netfence.it) X-Authentication-Warning: soth.netfence.it: Host alamar.local.netfence.it [10.1.2.18] claimed to be alamar.ventu Subject: Re: The mysterious kern.maxswzone To: vas@mpeks.tomsk.su References: <20190116022046.GA45024@admin.sibptus.ru> From: Andrea Venturoli Cc: freebsd-questions@freebsd.org Message-ID: <50f1f8d5-7db6-4abb-6beb-c82f17396304@netfence.it> Date: Mon, 21 Jan 2019 08:56:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190116022046.GA45024@admin.sibptus.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5369975030 X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [3.13 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.69)[0.693,0]; IP_SCORE(0.24)[ip: (0.70), ipnet: 2.44.0.0/16(0.35), asn: 30722(0.08), country: IT(0.06)]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[netfence.it]; NEURAL_SPAM_MEDIUM(0.90)[0.897,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mx.netfence.it]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.41)[0.410,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:30722, ipnet:2.44.0.0/16, country:IT]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 08:24:05 -0000 On 1/16/19 3:20 AM, Victor Sudakov wrote: > Dear Colleagues, > > I have a small 11.2-RELEASE-p8 i386 system with 512M swap and 256M RAM: As other said, "I'm not an expert here", so I'll just add my 2c, hoping it helps. > # swapinfo > Device 1K-blocks Used Avail Capacity > /dev/mirror/gm0s1b 524288 29656 494632 6% > > I guess it's not an extraordinary amount of swap for this amount of RAM. I agree it's not. I usually configure all my machine's swap as RAM x 4: the suggested rule is x2, but I don't want it to become x1 if I add more RAM :) > However, on boot I see the warning: > > warning: total configured swap (131072 pages) exceeds maximum recommended amount (113792 pages). > warning: increase kern.maxswzone or reduce amount of swap. Many of my systems show this warning: in general it's harmless and you can ignore it. Furthermore, in your case the two numbers (131072 and 113792) are very close, so you are already able to use more than 86% of your swap. Bottom line is: you need some small amount of RAM to manage swap. This small amount of RAM is proportional to the amount of swap you want to be able to have. So increasing this value will let you add more swap at the cost of some spare RAM. I would think twice about increasing this, given the small total RAM you have. > # sysctl kern.maxswzone > kern.maxswzone: 36175872 This is strange: on all my boxes (all 11.2/amd64) kern.maxswzone=0. If you did not set this manually (where, I don't know), perhaps this is an i386 vs amd64 thing. > I have some questions: > > 1. Where is this kern.maxswzone tunable documented? Some months ago I looked into this and found no official docs. However, searching the web, some discussions came up which did shed some light: I don't have the link anymore, but I suggest you try and search. > 2. In what units is it measured? What is 36175872, are these bytes? I don't know. I (ignorantly) guess (hope) not: 34.5 MiB does not even come close to your swap size and it would look a bit too much to manage it (but I might be wrong here). > 3. How do I calculate kern.maxswzone to suit my amount of RAM and swap? > > 36175872/113792=317.91 which confuses me even more (division with > remainder?) Can't help you here. bye av.