Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Feb 2023 14:45:28 -0800
From:      jin guojun <jguojun@gmail.com>
To:        Paul Procacci <pprocacci@gmail.com>
Cc:        "Derek (freebsd lists)" <482254ac@razorfever.net>,  FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Current swap configuration: best practices?
Message-ID:  <CAE6yT5v-FvuBojmMPVPEuBC39rnaQxR19BKBKvvmmS5Ae3178A@mail.gmail.com>
In-Reply-To: <CAFbbPujbdNkkZweXRUEFX5=dmAO2CpnNLR1Od87QVJzxfMBBHA@mail.gmail.com>
References:  <5cd5040b-d6c9-7c5f-9eae-e7e8a098eaca@chezmarcotte.ca> <CAFbbPujbdNkkZweXRUEFX5=dmAO2CpnNLR1Od87QVJzxfMBBHA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000022307705f423e8ac
Content-Type: text/plain; charset="UTF-8"

On Tue, Feb 7, 2023 at 1:31 PM Paul Procacci <pprocacci@gmail.com> 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

<div dir=3D"ltr"><div dir=3D"ltr"></div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr" class=3D"gmail_attr">On Tue, Feb 7, 2023 at 1:31 PM Paul Proca=
cci &lt;<a href=3D"mailto:pprocacci@gmail.com">pprocacci@gmail.com</a>&gt; =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"ltr"><div><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote"><di=
v dir=3D"ltr" class=3D"gmail_attr">On Tue, Feb 7, 2023 at 1:49 PM Derek (fr=
eebsd lists) &lt;<a href=3D"mailto:482254ac@razorfever.net" target=3D"_blan=
k">482254ac@razorfever.net</a>&gt; wrote:<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex">About to configure some new servers for productio=
n, and it feels like <br>
for this configuration, there is no good reason to enable or provision <br>
swap.=C2=A0 Would love to understand if anyone has a different viewpoint.<b=
r>
<br></blockquote><div><br></div><div>For what it&#39;s worth, I haven&#39;t=
 configured swap on any of my systems for a long while.<br></div><div> Memo=
ry is plentiful and so long as you operate within the bounds of your physic=
al memory then there&#39;s nothing to fear.<br></div>There may be some edge=
 cases that I am personally unaware of where swap is actually useful, but I=
 haven&#39;t ran into any.<br clear=3D"all"></div><br></div><div>I know the=
 above isn&#39;t much, but just a comment from my personal perspective.<br>=
<br></div><div>~Paul</div><div><br></div><div>-- <br><div dir=3D"ltr">_____=
_____________<br><br></div></div></div></blockquote><div>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.</div><div> 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.</div><div><br></div><div>For some critical serve=
rs, I configure a few GB swap in case the little swap happens or the partit=
ion needs expansion. <br></div><div><br></div><div> 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.</div><div><br></div=
><div>-Jin<br></div></div></div>

--00000000000022307705f423e8ac--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE6yT5v-FvuBojmMPVPEuBC39rnaQxR19BKBKvvmmS5Ae3178A>