From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C5A6C138330 for ; Sat, 8 Oct 2016 00:27:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 133ABE0BDD; Sat, 8 Oct 2016 00:27:12 +0000 (UTC) Received: from icp-osb-irony-out8.external.iinet.net.au (icp-osb-irony-out8.external.iinet.net.au [203.59.1.225]) by pigeon.gentoo.org (Postfix) with ESMTP id 4FDBCE0BD2 for ; Sat, 8 Oct 2016 00:27:11 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DSBQDqPPhX/x+mO8tcGwEBAQMBAQEJAQEBgzwBAQEBAR2BAaUEljeGIAKBekwBAgEBAQEBAl4nhGIBAQQjZgsNCwICJgICVxMIAQGIS7MpjHUBCyaBB4U1gX2CWIQxYoI4glsFjzGKTo97iWkXhXSQdAJUS4RnMYhDAQEB X-IPAS-Result: A2DSBQDqPPhX/x+mO8tcGwEBAQMBAQEJAQEBgzwBAQEBAR2BAaUEljeGIAKBekwBAgEBAQEBAl4nhGIBAQQjZgsNCwICJgICVxMIAQGIS7MpjHUBCyaBB4U1gX2CWIQxYoI4glsFjzGKTo97iWkXhXSQdAJUS4RnMYhDAQEB X-IronPort-AV: E=Sophos;i="5.31,457,1473091200"; d="scan'208";a="97283292" Received: from unknown (HELO mail.vm.localdomain) ([203.59.166.31]) by icp-osb-irony-out8.iinet.net.au with ESMTP; 08 Oct 2016 08:26:53 +0800 Received: from localhost (localhost [127.0.0.1]) by mail.vm.localdomain (Postfix) with ESMTP id E5A1B5BB62 for ; Sat, 8 Oct 2016 08:26:52 +0800 (AWST) X-Virus-Scanned: amavisd-new at localdomain Received: from mail.vm.localdomain ([127.0.0.1]) by localhost (mail.vm.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YLiPnNfs8mqc for ; Sat, 8 Oct 2016 08:26:50 +0800 (AWST) Received: from [192.168.44.7] (rattus.lan.localdomain [192.168.44.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wdk) by mail.vm.localdomain (Postfix) with ESMTPSA id 257AF5BB5E for ; Sat, 8 Oct 2016 08:26:50 +0800 (AWST) Subject: Re: [gentoo-user] Strive for zero swap usage? To: gentoo-user@lists.gentoo.org References: <15716586.VkCrMUdRYY@serenity> From: Bill Kenworthy Message-ID: <738fc0bd-6dd7-dfa8-94fb-334befe03dad@iinet.net.au> Date: Sat, 8 Oct 2016 08:26:50 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 0f558b81-3039-4fb1-8798-24db2bb26943 X-Archives-Hash: 5710b2e7e4bbf74ec0820dc0c3e2b6e6 On 08/10/16 07:43, Grant wrote: >>>>>> Swap usage on Linux always seems a little tricky to me. Should my >>>>>> goal on a web server be zero swap usage, meaning the attached graph >>>>>> should show no green lines at all if I'm doing it right? > ... Have you tuned swappiness? e.g.: vm.swappiness=1 vm.vfs_cache_pressure=50 You can force minimal use of swap as well as turn it off. I have tried to go swap-less a few times and have come to the conclusion you are trading occasional slow downs for the certainty of a crash and burn when you hit an unexpected memory requirement. I have swap (2xram - mostly for hibernation), but tune it as above. rattus ~ # free total used free shared buff/cache available Mem: 4041520 1605108 147588 19500 2288824 2083800 Swap: 4194300 356 4193944 rattus ~ # BillK