From: Michael Mol <mikemol@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Strive for zero swap usage?
Date: Fri, 07 Oct 2016 08:06:27 -0400 [thread overview]
Message-ID: <15716586.VkCrMUdRYY@serenity> (raw)
In-Reply-To: <CAN0CFw0_ZkejasKUB2tHYwkZfa5BYTpiy9kV2rcQv+jbx3vWDg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1906 bytes --]
On Friday, October 07, 2016 04:33:27 AM 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?
> >>
> >> No. You want things that aren't in use to be swapped, like memory
> >> leaks and such. You don't want things that will be used to be
> >> swapped.
> >
> > Does this look OK? It looks to me like heavy swapping in and out with
> > plenty of free memory (minus buffers/cache).
>
> Or put another way, how do I know when swapping is a problem? I'm
> running munin so I can look over graphs of my system's characteristics
> but I'm not sure what to look for to determine if I'm swapping
> excessively.
"Swapping excessively" is inherently a use-case-specific problem, but it comes
down to two questions:
* Do you notice your system spending time in iowait swapping data in while
you're waiting on it?
* Do you notice your system spending time in iowait swapping data out while
you're waiting on it? (I.e. as it tries to make room for new memory
allocations)
If the answer to those questions is yes, then you're swapping excessively. If
not, you're not.
There are ways other than swap to find yourself in iowait, though. I wonder
what might a good metric of combining iowait numbers with swap event counts.
Swap events without iowait are likely imperceptible.
But it does all come down to perception and how you want to manage it. I have
some nodes that swap a *lot*, but I don't care as long as they don't fall
behind in their workload. And I have some nodes that I don't permit to swap at
all, as that causes latency spikes that are difficult to nail down, or can cause
snowballing cascade events across several nodes and processes that interact
with each other.
--
:wq
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-10-07 12:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 21:51 [gentoo-user] Strive for zero swap usage? Grant
2016-10-06 22:03 ` Rich Freeman
2016-10-06 22:31 ` Grant
2016-10-07 11:33 ` Grant
2016-10-07 12:06 ` Michael Mol [this message]
2016-10-07 23:43 ` Grant
2016-10-08 0:26 ` Bill Kenworthy
2016-10-08 2:29 ` Bill Kenworthy
2016-10-08 11:58 ` Grant
2016-10-08 12:09 ` Grant
2016-10-08 19:27 ` [gentoo-user] " Kai Krakow
2016-10-08 23:03 ` Håkon Alstadheim
2016-10-09 13:25 ` Grant
2016-10-09 17:07 ` Kai Krakow
2016-10-10 14:24 ` [gentoo-user] " Michael Mol
2016-10-10 6:45 ` Jeremi Piotrowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15716586.VkCrMUdRYY@serenity \
--to=mikemol@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox