pcp
[Top] [All Lists]

Re: [pcp] proc.runq.swapped

To: pcp@xxxxxxxxxxx
Subject: Re: [pcp] proc.runq.swapped
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Thu, 20 Aug 2015 11:58:24 +0300
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <55D57D3D.5050900@xxxxxxxxxx>
Organization: Red Hat
References: <55D57D3D.5050900@xxxxxxxxxx>
Reply-to: myllynen@xxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0
Hi,

On 2015-08-20 10:09, Marko Myllynen wrote:
> 
> I'm using this script to see which processes have (parts of) their memory
> swapped:
> 
> #!/bin/sh
> #
> # Total swap usage as shown by free(1) and /proc/swaps does not exactly match
> # with the swap usage summed up for individual processes as done below due to
> # pages in swap cache being included in free(1) and /proc/swaps usage amount.
> 
> for p in /proc/[1-9]* ; do
>   awk '/^[0-9]+ \(/ {printf "%-8s%-18s", $1, $2; nextfile} \
>     /Swap:/ {swap+=$2} END {printf "%8.4f MB\n", swap/1024}' $p/stat $p/smaps 
> \
>       2>/dev/null ;
> done|sort -gk3|awk '{s=s+$3;print $0}END{printf "Total:%28.4f %s\n", s, "MB"}'
> 
> On a busy test system it reports 63 (all being user-land processes) but
> proc.runq.swapped is zero.

testing a bit more on my RHEL 7 laptop, now the script reports 119
processes and pmprobe -v proc.runq.swapped reports:

proc.runq.swapped 1 4

So something causes the metric to change but reading the source doesn't
really tell me what this 4 is supposed to represent?

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>