From owner-freebsd-questions@freebsd.org Mon Jun 18 16:08:16 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 8C9D11010616; Mon, 18 Jun 2018 16:08:16 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-vk0-x242.google.com (mail-vk0-x242.google.com [IPv6:2607:f8b0:400c:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2417785DAF; Mon, 18 Jun 2018 16:08:16 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-vk0-x242.google.com with SMTP id o71-v6so9873790vke.7; Mon, 18 Jun 2018 09:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=pxCo33lm8wFiDXrtJUjAZYo6oCpfP6fBb9BnYU/EtuE=; b=tPG0+p0Mi9OLF3EwmpQp3ptjfV/qESdNmVS1oELqTXedG0n58B7hC3D57LevM36KPC iNFZQ7kek2N94ujWfJI+NkNnyYedtRs0otXrI8H4Fv/gKhRVzIWXsys2DrYfpKvY+8Nk /bjFmaJqqfbWRc5tcXXAn9oD5TQ2d2QBZa3XfZr3ADG291VnxqT+fpoYz5Lvw52lbS91 Dh20Z8xl6ExGx7njB0d5oKguQHrJ1pxCPIvvoYquW5ZWZ6n/cnIEWTf3Ujok6Rwr13VQ QpZiBSrDeumvMM1w5AIc4f0Gn6uCNEf7mwtanV+gMsRKGSeTK/vZzN12Pm/AtPb5greP F4zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=pxCo33lm8wFiDXrtJUjAZYo6oCpfP6fBb9BnYU/EtuE=; b=bpje0qVxzoEwQXAnjRbuEp848YDt/YW48aYdC5GsSV8R1Ej2nUdc++8PXoG3VnxVee iT4TNwc/GYeho0NRoGquTFOtsTJhfQabp1c6sis1rBriPM6glVD+mqqmoThc8/xHyruz vT8E6EMaDxzg5YCfQ+XVRjgTsMkII11DQsOAiGAts0vVcJuveJYuqgxLc62BqGOxWHKs 17X4z27F+lrpHoS59Nvd26EjAbokMxO73rWs/t6W9c7oEeEuYSTgvGc9Z3nL89k02BWQ VW+vAGf5STFdJbMWTE97kgen/Zf3GB4Ps934nphub+nmr7rzDqWZ9R7bHTHAy5SdEe+5 v9HA== X-Gm-Message-State: APt69E0y+DUlTo8esS7VnHd6crwTALi8rgGe3nZNPFqQRQ8kmextRo/v Zt48+SgYH4dIJ7vFF0wEsZetGrzSF+pAWYP8RhEQotoJ X-Google-Smtp-Source: ADUXVKJG7xl7vzs7NK0xS/t4FT5bTa9d9iShyfNgVgg0E0qyjktXKw357lge3BMcipsj31Ic9HBafuycFoYAJ7L0nvs= X-Received: by 2002:a1f:5fc1:: with SMTP id t184-v6mr7398762vkb.140.1529338095424; Mon, 18 Jun 2018 09:08:15 -0700 (PDT) MIME-Version: 1.0 Sender: kob6558@gmail.com Received: by 2002:a67:8f05:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 09:08:14 -0700 (PDT) In-Reply-To: References: <20180618160855.44d9a0c2.freebsd.ed.lists@sumeritec.com> From: Kevin Oberman Date: Mon, 18 Jun 2018 09:08:14 -0700 X-Google-Sender-Auth: a9IT67Z68sR0VOyrINCi-XLNw0M Message-ID: Subject: Re: lightly loaded system eats swap space To: tech-lists Cc: FreeBSD-STABLE Mailing List , Mailinglists FreeBSD Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2018 16:08:16 -0000 On Mon, Jun 18, 2018 at 5:27 AM, tech-lists wrote: > On 18/06/2018 09:08, Erich Dollansky wrote: > >> Hi, >> >> On Sun, 17 Jun 2018 23:19:02 +0100 >> tech-lists wrote: >> >> freebsd-11-stable r333874, ZFS raidz1-0 (3x4TB disks), 128GB RAM, >>> Swap: 4096M Total, 3502M Used, 594M Free, 85% Inuse >>> >> >> this might not be related but I noticed that your swap space is small >> compared to RAM size. I noticed on a much smaller Raspberry Pi, that it >> runs into trouble when there is no swap even there is enough RAM >> available. Is it easily possible for you to add some GB of swap space >> and let the machine run then? >> >> How much swap do the other machines have? >> > > Hi, > > Yes, the machine with the problem uses the default 4GB swap. That's all > the swap it has. The machine without issue has a swapfile installed on a > SSD in addition to the default 4GB swap. > > problematic machine: > Device 512-blocks Used Avail Capacity > /dev/ada0p3 8388608 3.3G 714M 83% > > machine without a problem, it has swapfile installed: > Device 512-blocks Used Avail Capacity > /dev/ada0s1b 8262248 1.7G 2.2G 44% > /dev/md0 65536000 1.9G 29G 6% > Total 73798248 3.7G 32G 10% > > I added the swapfile a long time ago on this machine due to the same issue. > > But my problem isn't so much an out of swapspace problem; all this is, is > a symptom. My problem is "why is it swapping out at all on a 128GB system > and why is what's swapped out not being swapped back in again". > > thanks, > -- > J. Small correction. Your problem is "why is it swapping out at all on a 128GB system ." Once pages are swapped out, they are never swapped back in until/unless they are needed. There is no reason to waste time/disk activity to swap pages back into memory unless they are required. RAM is always more valuable than swap. Ir is easy to write a process that eats up a large amount of memory, then goes idle without freeing it. The memory will get pages out, fill swap, and, unless the process terminates or becomes active, will consume up a great deal of swap space "forever". Firefox is a good example of this. I have to restart it every day or two and occasionally will run out of swap which results in a nearly deadlocked system. It can take many minutes to just kill firefox. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683