LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 04-11-2009, 02:32 AM   #1
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Rep: Reputation: 30
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
 
Old 04-11-2009, 07:37 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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.
 
Old 04-11-2009, 01:34 PM   #3
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Original Poster
Rep: Reputation: 30
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
 
Old 04-11-2009, 02:36 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
To get the pagesize, simply run the "pagesize" command.
As for the block size, it is 512 bytes by Unix convention.
 
Old 04-13-2009, 12:35 AM   #5
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Original Poster
Rep: Reputation: 30
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
 
Old 04-13-2009, 04:59 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
What says "vmstat 1 2" free column ?
 
Old 04-13-2009, 09:22 AM   #7
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Original Poster
Rep: Reputation: 30
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
 
Old 04-14-2009, 12:43 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
It might be a sar bug. Try installing patch 138318-02.
http://sunsolve.sun.com/search/docum...ssetkey=138318
 
Old 04-14-2009, 02:32 AM   #9
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Original Poster
Rep: Reputation: 30
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
 
Old 07-05-2010, 02:48 PM   #10
raviux
LQ Newbie
 
Registered: Oct 2008
Posts: 3

Rep: Reputation: 0
ravi

yes don't do X2 :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
top, ps, sar which gives accurate data for CPU utilization makam.sreekanth Linux - Newbie 6 03-20-2009 09:39 AM
Question on top, ps and sar output Sathya Linux - Newbie 3 10-19-2007 12:58 AM
Difference in SAR and TOP result ImranAthar Linux - General 0 08-29-2007 09:04 AM
Conflicting data from sar & top clindo Red Hat 0 05-15-2007 09:20 AM


All times are GMT -5. The time now is 09:18 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration