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 CF1E2138330 for ; Fri, 7 Oct 2016 23:44:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1CDC821C07E; Fri, 7 Oct 2016 23:43:58 +0000 (UTC) Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C485DE0BC8 for ; Fri, 7 Oct 2016 23:43:57 +0000 (UTC) Received: by mail-qk0-f173.google.com with SMTP id z190so43648441qkc.2 for ; Fri, 07 Oct 2016 16:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=eEtwhlD2hypLeEadWtU08FioUfSv+KPwSEtziaB1wFQ=; b=fGedEdxREn3oIv3bMIoj5bm1meJ6QwYrj9zwC/vo6EQd2ZM12p/tFx2lMVGAt6aUg2 LLpU3kBuXGXf6UI1xrDivX5w6x5p4TLbKgszRSDNFtTakt8YJjgUZA48sCpLN86Ft0s3 SZl9o7/zjbHSjme6//oUPW2pxTP/cO+FNdAYiQubKhTqdOZVAkC3RY20HTHbcEPZ49Pl p6l6YiieTnFYZZmUjN+SlVkmM277cAFfi2bGdM+4ARjK8iUogFvZJxpNmUChlkI9eHKr iULfpOyQQbIr2+S0COg+iTmZpa3HM7vEk7ghA3hdtgFTJ4QURLk6MN5a/JrlhgWi588f vITg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=eEtwhlD2hypLeEadWtU08FioUfSv+KPwSEtziaB1wFQ=; b=iHojm5Dx6V0WCTRQ5gyujkXN4t8f5M3WcfzvxUTiy259ehiabqHDVnBDZn0WCGr9Hi tt9fW8oYu7HQFY0fgJLqUFKp7PpJdsVrSB3jW1GHiJs3N7AawxHlEN+Lwi+/mTN9lfdw FiZi+RdUCdBIK9Soc7Lo1q4781b7K12DkgOckB4vg4o4qSbvYCkEUb9nxi0y2C1+qQHf ZssmT8St5Nfv9LhQSyTQFYk02FahesTyzApdqDMlxidSpSERGPE6PgBFZqHv6lnkOz+c 7aet2pNLOPgrVhQ8+AFZfd5UvQcf/uOEqf+dG/Ft8szRSsW/3tpJa8K0xIeaXDSoFSIu OA1w== X-Gm-Message-State: AA6/9RlKDrJalA4jUbrMJRgNZhhA2FBmtJ5W6TBxUzyKeHB87br6I4NX6xDKJwBpjBpsfQ8jtn5xeXf2/OENhA== X-Received: by 10.55.160.149 with SMTP id j143mr20725869qke.274.1475883836740; Fri, 07 Oct 2016 16:43:56 -0700 (PDT) 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 Received: by 10.140.38.133 with HTTP; Fri, 7 Oct 2016 16:43:56 -0700 (PDT) In-Reply-To: <15716586.VkCrMUdRYY@serenity> References: <15716586.VkCrMUdRYY@serenity> From: Grant Date: Fri, 7 Oct 2016 16:43:56 -0700 Message-ID: Subject: Re: [gentoo-user] Strive for zero swap usage? To: Gentoo mailing list Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 8fde9674-a237-4ac8-9345-19cf0cbcd2a0 X-Archives-Hash: 797427472b1c17646b9f45b2bd522cb1 >> >>> 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) I can't find a good graph for iowait in munin. Is watching wa in top my best bet? If I do find a correlation between iowait and web server response times, should I just decrease memory usage until the problem goes away? What I do notice is that my web server's response time increases along with the swapping peaks in the graph I posted before. - Grant > 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.