parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG: swap_activity broken in v20120322


From: Benjamin R. Haskell
Subject: Re: BUG: swap_activity broken in v20120322
Date: Fri, 30 Mar 2012 08:30:07 -0400 (EDT)
User-agent: Alpine 2.01 (LNX 1266 2009-07-14)

On Fri, 30 Mar 2012, Thomas Sattler wrote:

Hi Ole,

you did not (yet) comment the BUG, so I've had a closer look at the reported issue:

vmstat 1 2 2>/dev/null | tail -n1 | awk '{print $7*$8}' ||
  vm_stat 1 | head -n 3 | tail -n1 | awk '{print $9*$10}'

Better `awk` usage:

vmstat 1 2 2>/dev/null | awk 'END {print $7*$8}' ||
vm_stat 1 | awk 'NR == 3 {print $9*$10 ; exit}'


The idea seems to be "run 'vmstat' and run 'vm_stat' in case 'vmstat' failed". But in fact it is only *one* commandline where 'vm_stat' is run in case *awk* failed.

The following commands demonstrate this:

$ false | tail | true || date  # <-- date is not run
$ true | tail | false || date  # <-- date is run
    \              \
     \__ vmstat     \__ awk

If somebody would reply with the output of 'vm_stat', I'd offer a patch to fix the issue. (I don't have a MAC.)

osx-server$ vm_stat 1
Mach Virtual Memory Statistics: (page size of 4096 bytes, cache hits 0%)
  free active   spec inactive   wire   faults     copy    0fill reactive  
pageins  pageout
 70547 442624  29441    88468 415463   14321M  518664K 2448176K   683760  
1460755   367311
 70658 442657  29440    88468 415463      139        0      136        0        
1        0
 70729 442660  29440    88468 415463      145        0       73        0        
0        0
 70461 442660  29440    88468 415463      388       69      134        0        
0        0
70478 442649 29440 88468 415463 16 0 6 0 0 0 [...etc...]

Not sure $9*$10 is the right expression to use. "reactive * pageins"? On a very lightly-loaded server, that gets: 998807890080

--
Best,
Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]