From owner-freebsd-questions@freebsd.org Tue Feb 11 15:55:59 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB6FA239DEE for ; Tue, 11 Feb 2020 15:55:59 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48H6nV6NrKz4C0N for ; Tue, 11 Feb 2020 15:55:58 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.26.136]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPA (Nemesis) id 1N5lvf-1jY6Vu1ggl-017DLJ; Tue, 11 Feb 2020 16:55:53 +0100 Date: Tue, 11 Feb 2020 16:55:52 +0100 From: Polytropon To: tech-lists Cc: freebsd-questions@freebsd.org Subject: Re: questions about swap (partition and file) Message-Id: <20200211165552.e122bf2c.freebsd@edvax.de> In-Reply-To: <20200211155009.GA9715@bastion.zyxst.net> References: <20200211155009.GA9715@bastion.zyxst.net> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:BRI+Zi5QOqjBj+q36RWHZHqjmowewASNQ6RuLuWlfEq7Ki4RZAC cH8n5rQCzf31D8Ifpkh0pIuUhdkbPCXBXYHTzZ6ab+Xk9+M7Gv55RdHeVCrUR1a7rSBVh5x 0VSLbxXlRmSwe7s1ftnd/UW/fuGdQaHvI6AK4vkFmCSI7E8SranG3mryWNpEvk8+mZSchlS QL+fRU6TUmkxdMH2l99eA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:91NQMGHWYPg=:mQ9pLdoaoI2M9ajEqeoW/6 lMIEg4BpqApB/8B2tBdeB3xTfbdhRkduPtBlbfXApdjkKBiwubLHP2vNKGB9x9HWD7jWAitAl vz7DbwaAyXfPVgeeZYuJSnAXq6JUZsPsfX8P6dy60Qd1FLPHdSySEjK7/duxldlMDlOrlIrIx Hn8lS9pErTQMvFjQ1S/jgONxSLLeEBYTZy+WW8KximEHD9QompDJsnWkr7VG46mAehzDBTXDa Cv0rGjFfxywnayLle6II6+xK+KjrrZ/mYrICG9IFJZmiXzF/tUFf7QXPr3lySgJPK4PdbJg9L uX5gVRoOPMqGJFD4SZRNWmQuAzowtzR4X2l2MJ9LIBtGMlS+mRQ7Llv7Npg6FjJ//WGieypkF Snkt+ag3Z1zkhYHbY+QWypEpaFHZMW8HsG+K3AAPyve8v/XL4s38B1KrCV+yWAGSWJ2gyHaS6 A6b0ioUsSYF7r0JT2kAQZjMrS4SPg4nLQnzoEsu5Re0ixv8LToW67f1J3kt5/jg4jO9a2lLY3 6kuHwzrx5/FCNZeN4dPGY0DWly12MEe9ohfAzSwUpREzd2IX4L9+iADaGu4lVa/AtTtqcRh74 nSEDaDZOPhu/aTs/am9NI8suuV7rp7+uVpDz1N9sKjKRPZTP18tlNv7Aji5ls96+18ERhlkyD EBXcAgQv1QEZQOsFbJNKXxmjed+WAOoZjKy/h52eioWljm0VamhCQilSlUlWBezHrzNczwRw3 sQgnDfOfhSCxcjvVsnc53I6/D7YJ8AWp2Cxzy3Vdoax8Zox3d7732jN5RTsXFuzGsmkaU6x1/ PVNg41BkgQG+jUUev98CcWqDAhNBXSdhiv0jO/LS8N9na6NVA8g8oWrUF3M6r/XBR8jukcm X-Rspamd-Queue-Id: 48H6nV6NrKz4C0N X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.135) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.26 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_PBL(0.00)[136.26.222.94.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.48)[-0.478,0]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[0.999,0]; RCVD_IN_DNSWL_NONE(0.00)[135.126.227.212.list.dnswl.org : 127.0.5.0]; MID_CONTAINS_FROM(1.00)[]; R_SPF_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[135.126.227.212.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.34)[ip: (0.60), ipnet: 212.227.0.0/16(-1.12), asn: 8560(2.23), country: DE(-0.02)] 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: Tue, 11 Feb 2020 15:56:00 -0000 On Tue, 11 Feb 2020 15:50:09 +0000, tech-lists wrote: > Which is it better to have - swapfile partition or swapfile? > > I have both, on a SSD. Thing is, I can write 10x faster to the > file than I can > to the partition. With a 512b block size, it can write at 17MB/s > to the > partition, and about 120-130MB/s to the swapfile, as reported by dd. Probably a partition is better because it saves the subsystems accessing it to deal with the filesystem layer. A swap device does not have a filesystem, and it's not under VFS control, so no overhead of that kind. However, it is possible to "emulate" a swap device with a file, and there are probably several ways to do this (for example, virtual node: mdconfig + swapctl, also possible as "on demand" solution where space will only be claimed when there's an actual need for it). > Historically, ISTR that it was recommended to have several swap > partitions on > the fastest disks available, and that swapfile was slower than > a partition > because of something like fat translation. It was also suggested to make the swap partition = 2 x maximum RAM of machine... :-) > Is this still the case nowadays? > Is there a better way of measuring swap speed than dd? I'm not sure. It probably depends on the swapping behaviour implied by your actual workloads. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...