From nobody Tue Feb 07 18:48:47 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PBBx52pDkz3nYtt for ; Tue, 7 Feb 2023 18:48:57 +0000 (UTC) (envelope-from 482254ac@razorfever.net) Received: from mta01.start.ca (mta01.start.ca [162.250.196.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.start.ca", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBBx412MPz4PJh for ; Tue, 7 Feb 2023 18:48:55 +0000 (UTC) (envelope-from 482254ac@razorfever.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of 482254ac@razorfever.net designates 162.250.196.97 as permitted sender) smtp.mailfrom=482254ac@razorfever.net; dmarc=none Received: from mta01.start.ca (localhost [127.0.0.1]) by mta01.start.ca (Postfix) with ESMTP id 7E78020950 for ; Tue, 7 Feb 2023 13:48:49 -0500 (EST) Received: from mail.razorfever.net (unknown [45.59.188.50]) by mta01.start.ca (Postfix) with ESMTPSA id 6F00D20949 for ; Tue, 7 Feb 2023 13:48:49 -0500 (EST) Received: from [192.168.0.33] (bock.razorfever.net [192.168.0.33]) by mail.razorfever.net (8.15.2/8.15.2) with ESMTP id 317ImlpL015790 for ; Tue, 7 Feb 2023 13:48:47 -0500 (EST) (envelope-from 482254ac@razorfever.net) X-Authentication-Warning: mail.razorfever.net: Host bock.razorfever.net [192.168.0.33] claimed to be [192.168.0.33] Message-ID: <5cd5040b-d6c9-7c5f-9eae-e7e8a098eaca@chezmarcotte.ca> Date: Tue, 7 Feb 2023 13:48:47 -0500 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US To: FreeBSD Mailing List From: "Derek (freebsd lists)" <482254ac@razorfever.net> Subject: Current swap configuration: best practices? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.4 required=5.0 tests=ALL_TRUSTED, FROM_STARTS_WITH_NUMS,RP_MATCHES_RCVD autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.razorfever.net X-Virus-Scanned: ClamAV using ClamSMTP X-Spamd-Result: default: False [-2.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; R_SPF_ALLOW(-0.20)[+ip4:162.250.196.0/24]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; DMARC_NA(0.00)[razorfever.net]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:40788, ipnet:162.250.196.0/22, country:CA]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_XAW(0.00)[]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4PBBx412MPz4PJh X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N About to configure some new servers for production, and it feels like for this configuration, there is no good reason to enable or provision swap. Would love to understand if anyone has a different viewpoint. The configuration is such that the disks (NVMe) are only 4-8x the size of physical RAM, and there is a lot of RAM + cores (128GB/1TB & 256GB/1TB). Working sets will fit easily into RAM. From the handbook: * the swap partition should be about double the size of physical memory (RAM) From the Architecture Handbook: * You should have at least 2x the swap space as you have main memory, and possibly even more if you do not have a lot of memory. * You should also size your swap partition based on the maximum memory configuration you ever intend to put on the machine so you do not have to repartition your disks later on. Using ZFS: * enabling mirror swap will break crash dumps My previous typical setup: * tweaked bsdinstall to create freebsd-swap partition * use gmirror + geli to mirror and encrypt swap * no dumps currently enabled * zfs mirror + stripe data/root volume I've reviewed both: https://forums.freebsd.org/threads/exploring-swap-on-freebsd.78418/ and the message archives. I found the thread talking about ANON mmap'd pages, curious how those go with swap disabled, mmap(2) doesn't mention anything. It seems like with "large" RAM, no dumps, and "small" NVMe-backed storage, there is no reason to enable swap - and certainly not the official recommended 2xRAM. What am I missing here? Thanks, Derek