From nobody Tue Feb 7 22:45:28 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 4PBJBD2Yd2z3np8P for ; Tue, 7 Feb 2023 22:45:40 +0000 (UTC) (envelope-from jguojun@gmail.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBJBD01xkz3kwl for ; Tue, 7 Feb 2023 22:45:40 +0000 (UTC) (envelope-from jguojun@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72b.google.com with SMTP id bl15so7335484qkb.4 for ; Tue, 07 Feb 2023 14:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JxPDZD6oCx8UMidY9Pc0RbTc5hxg/0PNJSOyo1mYP0Y=; b=Nl36fHyiIkz0KVJz1uPTAvRhpdVWRcMlguIzPaWYJh7CG31VaLvnktjfyzzu6VaM4C QeQP9M2lqGy4s3WOZ99HyyEMxxHkCBelYAovLNtQLCqGL1uEwCwlFRQ0zVOdx1OYvkkb BNg8U6WLqyXi0C/JSHcxt473Qodz0pu8cNcIS2FLLmlvi/XYu1/XGaZrI7Ik9K6urkRD IB+rUN0ytdlGdV+3adUfEQPF2zAOxgp9PArmha6911t236UMW+ztu2aVWmzaX7rSIP6U XOSrTBHg8jl34wZYo+8xLicdJSPGcxUN5o12ytPNc9+OnX7mrPrup+Wz18DGaWeZq6tO H/8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JxPDZD6oCx8UMidY9Pc0RbTc5hxg/0PNJSOyo1mYP0Y=; b=Hn7bLTLHskhSkPGG7FieRvT74CHfFNkhtBUr7V+jbdr1+MpdJF1c2jo7bnzbQmI9er UTlYSmPJWm753Y+tR9CMON4Qngt45NlHdOGdj9tyA0XNkBR9tW8VpToQG1V/7ZvhttPB iOFuvnEjtcAinXcydPDDEOlKwYqvtFD7R5fVoxEPvW+IeRm6hafJH26KhGEeGAr06a81 n1WFIkm6Z4cedE/A5flQufJDVg8KK5nKhXrUh1PqPmfdxDMCXW8Zgr7/+Fmuy97lx0wH Vi5M2fcrSLFJMoDx/1XhT0X0QG/xuGmjtohi6/0Z8Fhpwp9rKMwacgH+FCYnDmF++LZp Vfgw== X-Gm-Message-State: AO0yUKXrRLk/ZUhnbeh499nb088G0Kc5H6e6+/KV88CQ/UPJn9RxiD/Z CFaOl7RGzoPAdr1UxSF+pDdANOSfBIbsh5CAbpyI9FwS5g== X-Google-Smtp-Source: AK7set9KVq/z/A7lM7AfOvN1KBuTTdZvIpc4PpnjbUy7tUkb3secfP2u64aRYvNhC6Gz/LnsLPgFsxa7ZqssLp9T9QQ= X-Received: by 2002:a05:620a:48c:b0:721:f1f1:d2a7 with SMTP id 12-20020a05620a048c00b00721f1f1d2a7mr327184qkr.371.1675809939139; Tue, 07 Feb 2023 14:45:39 -0800 (PST) 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 References: <5cd5040b-d6c9-7c5f-9eae-e7e8a098eaca@chezmarcotte.ca> In-Reply-To: From: jin guojun Date: Tue, 7 Feb 2023 14:45:28 -0800 Message-ID: Subject: Re: Current swap configuration: best practices? To: Paul Procacci Cc: "Derek (freebsd lists)" <482254ac@razorfever.net>, FreeBSD Mailing List Content-Type: multipart/alternative; boundary="00000000000022307705f423e8ac" X-Rspamd-Queue-Id: 4PBJBD01xkz3kwl X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000022307705f423e8ac Content-Type: text/plain; charset="UTF-8" On Tue, Feb 7, 2023 at 1:31 PM Paul Procacci wrote: > > > On Tue, Feb 7, 2023 at 1:49 PM Derek (freebsd lists) < > 482254ac@razorfever.net> wrote: > >> 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. >> >> > For what it's worth, I haven't configured swap on any of my systems for a > long while. > Memory is plentiful and so long as you operate within the bounds of your > physical memory then there's nothing to fear. > There may be some edge cases that I am personally unaware of where swap is > actually useful, but I haven't ran into any. > > I know the above isn't much, but just a comment from my personal > perspective. > > ~Paul > > -- > __________________ > > The swap is usually for computers with less memory in the past to make computers usable when too many jobs are running. The two times of physical memory is ideally for maximum two sets of processes using the entire memory. More swap area means more time will be spent on swapping. If a machine has 1TB DDR, then 2TB swap makes no sense at all because the time of swapping 2TB memory with disk is significant. For some critical servers, I configure a few GB swap in case the little swap happens or the partition needs expansion. In the real world, swap area helps for some small and short life processes, but not useful for large and long life processes. For example, a 3-D imaging process needs 10GB memory to run and can finish in an hour on a PC with 16GB DDR, but will not finish in months on a PC that has a 8GB DDR + 16+GB swap because every row or column operation involves cache miss, fetch DDR, and swap, which cost 1000 or even more times of cycles than normal operations. -Jin --00000000000022307705f423e8ac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Tue, Feb 7, 2023 at 1:31 PM Paul Proca= cci <pprocacci@gmail.com> = wrote:


On Tue, Feb 7, 2023 at 1:49 PM Derek (fr= eebsd lists) <482254ac@razorfever.net> wrote:
About to configure some new servers for productio= n, and it feels like
for this configuration, there is no good reason to enable or provision
swap.=C2=A0 Would love to understand if anyone has a different viewpoint.

For what it's worth, I haven't= configured swap on any of my systems for a long while.
Memo= ry is plentiful and so long as you operate within the bounds of your physic= al memory then there's nothing to fear.
There may be some edge= cases that I am personally unaware of where swap is actually useful, but I= haven't ran into any.

I know the= above isn't much, but just a comment from my personal perspective.
=
~Paul

--
_____= _____________

The swap is usuall= y for computers with less memory in the past to make computers usable when = too many jobs are running. The two times of physical memory is ideally for = maximum two sets of processes using the entire memory. More swap area means= more time will be spent on swapping.
If a machine has 1TB DDR, = then 2TB swap makes no sense at all because the time of swapping 2TB memory= with disk is significant.

For some critical serve= rs, I configure a few GB swap in case the little swap happens or the partit= ion needs expansion.

In the real world, swap= area helps for some small and short life processes, but not useful for lar= ge and long life processes. For example, a 3-D imaging process needs 10GB m= emory to run and can finish in an hour on a PC with 16GB DDR, but will not = finish in months on a PC that has a 8GB DDR + 16+GB swap because every row = or column operation involves cache miss, fetch DDR, and swap, which cost 10= 00 or even more times of cycles than normal operations.

-Jin
--00000000000022307705f423e8ac--