LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   How to convert the values displayed by sar -r with top (https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-convert-the-values-displayed-by-sar-r-with-top-718373/)

rajaniyer123 04-11-2009 02:32 AM

How to convert the values displayed by sar -r with top
 
Hi

I would like to know the formula to convert the o/p shown by sar -r with top in case of Freememory & Swapmemory.

top
_______________________________________________
load averages: 0.33, 0.38, 0.41 03:30:01
69 processes: 67 sleeping, 1 zombie, 1 on cpu
CPU states: 80.1% idle, 8.1% user, 11.8% kernel, 0.0% iowait, 0.0% swap
Memory: 8192M real, 1102M free, 5136M swap in use, 4771M swap free



sar -r
_____________________________________________________

00:00:00 freemem freeswap
03:30:00 71058 4893162


I want to know how I can convert 71058 & 4893162 in Memory/Swap in MB.

Thanks
Rajan

jlliagre 04-11-2009 07:37 AM

freemem*pagesize=free memory
freeswap*block size=free swap

pagesize is normally 4 kbytes on x86 and 8 kbytes on SPARC
block size is 512 bytes.

rajaniyer123 04-11-2009 01:34 PM

Hi

Thanks for your response, in the same ref. I would like to know that how I can check the default pagesize & block size of my system.

Thanks
Rajan

jlliagre 04-11-2009 02:36 PM

To get the pagesize, simply run the "pagesize" command.
As for the block size, it is 512 bytes by Unix convention.

rajaniyer123 04-13-2009 12:35 AM

Hi,
While calulating I found some descrepancy in case of converting Free Memory

freemem*pagesize=free memory

71058 * 8192 = 582107136/(1024*1024) = 555.14 MB

In our case it approx 1110 MB.

Please correct me if I am wrong.

Thanks
Rajan

jlliagre 04-13-2009 04:59 AM

What says "vmstat 1 2" free column ?

rajaniyer123 04-13-2009 09:22 AM

Please find herewith vmstat 1 2 o/p, also I have captured top & sar -r o/p for co-relation process.

top

load averages: 0.52, 0.53, 0.56 10:18:46
63 processes: 60 sleeping, 1 stopped, 2 on cpu
CPU states: 98.5% idle, 0.0% user, 1.5% kernel, 0.0% iowait, 0.0% swap
Memory: 4096M real, 951M free, 2901M swap in use, 1790M swap free

sar -r

00:00:01 freemem freeswap

10:00:01 143563 3873947
10:10:00 136551 3805651


vmstat 1 2

kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr m0 m1 m2 m3 in sy cs us sy id
0 0 0 2080408 1076848 43 256 15 3 4 0 6 2 2 2 0 559 3447 933 15 4 80
0 0 0 1828696 966008 7 25 16 0 0 0 0 4 2 2 0 550 28753 775 27 8 65


Thanks
Rajan

jlliagre 04-14-2009 12:43 AM

It might be a sar bug. Try installing patch 138318-02.
http://sunsolve.sun.com/search/docum...ssetkey=138318

rajaniyer123 04-14-2009 02:32 AM

Hi

It seems that there was bug in sar only. As I have tried the same in Solaris 10 5/08 s10s_u5wos_10 SPARC, it is working fine as per given formula.

top

bv-a00-00.app.prd.sec.audible.com root: top
last pid: 17175; load avg: 0.73, 0.62, 0.52; up 112+11:48:46 03:19:35
85 processes: 84 sleeping, 1 on cpu
CPU states: 95.3% idle, 4.0% user, 0.7% kernel, 0.0% iowait, 0.0% swap
Memory: 16G phys mem, 8925M free mem, 8193M total swap, 8193M free swap


sar -r 1 2

03:19:20 freemem freeswap
03:19:21 1142547 31821936



I have verified the same it gives correct value.

1142547*8192/(1024*1024)=8926 MB

Which is correct.

Thanks
Rajan

raviux 07-05-2010 02:48 PM

ravi
 
yes don't do X2 :-)


All times are GMT -5. The time now is 12:33 PM.