From owner-freebsd-questions@freebsd.org Mon Feb 5 20:08:27 2018 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 128A6EEBADE for ; Mon, 5 Feb 2018 20:08:27 +0000 (UTC) (envelope-from johnl@iecc.com) Received: from gal.iecc.com (gal.iecc.com [IPv6:2001:470:1f07:1126:0:43:6f73:7461]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gal.iecc.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC74586B18 for ; Mon, 5 Feb 2018 20:08:26 +0000 (UTC) (envelope-from johnl@iecc.com) Received: (qmail 54574 invoked from network); 5 Feb 2018 20:08:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:subject:mime-version:content-type:user-agent; s=d52c.5a78b9b9.k1802; bh=QksPE+srIgGPxaurkKdBLN6R2Sqegy3btBOupkAu7Bs=; b=Pm20V1opCwUZ+b0f+cJHt/beKxmzXuEtWL57IE4gCTKlhHYKLP6NbsMLmLeeoBEU40Klfg5KmvWaBiUFRQy6TH9Ucm4oGHLdKQslVWhct7qtJ3ayNmC9BsumUSxf8YMY1OHwXJADei3lSbEED1RqY0s/PO5vNBYqmwn2VEIh14ysWDnkmSPQjHoz/zSixIdaInq8HEturqnMHkEDhhtqVfg3EUHEylDNm3q0nb1teuqN66ISuo25fyk65PtpML3U Received: from localhost ([IPv6:2001:470:1f07:1126::78:696d:6170]) by imap.iecc.com ([IPv6:2001:470:1f07:1126::78:696d:6170]) with ESMTPS (TLS1.2/X.509/AEAD) via TCP6; 05 Feb 2018 20:08:25 -0000 Date: 5 Feb 2018 15:08:24 -0500 Message-ID: From: "John R. Levine" To: freebsd-questions@freebsd.org Subject: Re: Swap on SSD User-Agent: Alpine 2.21 (OSX 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 20:08:27 -0000 In article <24BAEBB4-FAA7-47C8-A6FC-32839063666F@kreme.com>, LuKreme wrote: >On Feb 5, 2018, at 09:13, Frank Leonhardt wrote: >> FreeBSD doesn't actually swap these days; uses demand paging. This means that blocks of RAM that are hardly ever used can get >copied to disk. This may include some stuff that's only accessed a few times a year, but would otherwise be occupying precious >RAM that would be much more useful as a disk cache. That said, FreeBSD tends not to page out except as a last resort - probably a >mistake but I can't prove it. That's right. The swap space is where it pages stuff that doesn't have a home anywhere else. A great deal of what's in memory is a copy of something on the disk, so if it's paged out, it goes back to the disk, or it's just deleted in the common case that it hasn't changed since being read in. Unless your system is trying to do something that wants a lot more R/W address space than is physically available, the system doesn't write much to the swap space. On one of my BSD cloud virtual machines I have a server process that slurps in about a gigabyte of stuff into a very large perl table, then sits there and answers queries from that table. The system swaps like crazy for a few seconds while it's loading up the table, then quiets down and reads a few pages a second from the swap as the queries come in. That's about the worst case, and only becasue I'm a cheapskate and don't want to pay for a larger VM where everything would fit in RAM. -- Regards, John Levine, johnl@iecc.com, Primary Perpetrator of "The Internet for Dummies", Please consider the environment before reading this e-mail. https://jl.ly