IRIX and Software

using 'sar' to get memory statistics

Hey all,

I consistently run 'sar -A' and store the data files on some of my production systems here at work. I need to pull out of them memory information... specifically how often memory is getting used up or swap space used.

It seems like running 'sar -R -f <my data file>' will give me exactly what I want.... the only problem is the output is in *pages*. The same thing for the '-r' option that gives info on 'unused memory pages and disk blocks'... it's in pages.

So what's the translation (on an Origin2000 system) of 'pages' to 'bytes' so I can look at my sar output and get some real info from it?

Also... if anybody has any helpful scripts (I'm trying to write one) that can take sar data files and easily pull out info in some readable type file, let me know! I've got one written for cpu info... just not memory.

-chris
Searching around, I found this:

cch.loria.fr/documentation/O2000/programmer/pdf/06chap1.pdf.gz

"Secondary cache lines are fixed in size at 32 words, or 128 bytes. Main memory page sizes are multiples of 4 KB, usually 16 KB."

The "usually" is kind of scary (a kernel configuration option?) but you should be able to double-check this. On my indigo2 the output of "sar -R" shows the physical memory to be 24576 pages. Assuming a page size of 16384 bytes: 24576 pages * 16384 bytes = 402653184 bytes / 1048576 = 384 megabytes. Which is what hinv shows.

Here's a csh one liner to print memory usge in megabytes for user programs:

echo "scale=10;"`sar -f sar.data -R | tail -1 | awk '{print $4}'`"*16384/1048576" | bc
dj wrote: Searching around, I found this:

cch.loria.fr/documentation/O2000/programmer/pdf/06chap1.pdf.gz

"Secondary cache lines are fixed in size at 32 words, or 128 bytes. Main memory page sizes are multiples of 4 KB, usually 16 KB."

The "usually" is kind of scary (a kernel configuration option?) but you should be able to double-check this. On my indigo2 the output of "sar -R" shows the physical memory to be 24576 pages. Assuming a page size of 16384 bytes: 24576 pages * 16384 bytes = 402653184 bytes / 1048576 = 384 megabytes. Which is what hinv shows.

Here's a csh one liner to print memory usge in megabytes for user programs:

echo "scale=10;"`sar -f sar.data -R | tail -1 | awk '{print $4}'`"*16384/1048576" | bc


Dude!!! That is awesome! That's exactly what I needed! My system does indeed use 16Kb for it's page size, because doing the same calculation that you did on your indigo2 gives me 8192Mb.... which is what hinv shows.

And that csh one liner also works perfectly. I can easily modifiy it to handle different options to sar... just making sure I know which column to awk out.

Thanks a ton! Now I can write a wrapper script to use that line and operate on list of sar data files. :)

-chris
dj wrote: echo "scale=10;"`sar -f sar.data -R | tail -1 | awk '{print $4}'`"*16384/1048576" | bc


that's neat.
thanks as well.
r-a-c.de
The page size in Irix is actually dynamically variable per process, and I think maybe even per thread or even more finely grained... actually, I think you can set any chunk of a process's address space to a different page size.

Pretty scary, huh? I believe this feature is totally unique to Irix.

http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=bks&srch=&fname=/SGI_Developer/MMC_PG/sgi_html/ch02.html
lewis wrote: The page size in Irix is actually dynamically variable per process, and I think maybe even per thread or even more finely grained... actually, I think you can set any chunk of a process's address space to a different page size.

Pretty scary, huh? I believe this feature is totally unique to Irix.

http://techpubs.sgi.com/library/tpl/cgi ... /ch02.html


That's awesome. Who would be crazy enough to need 16 megabyte pages?

I have no idea how that would affect sar's output then. In the techpubs article they mention "You can use the osview(1) command to view the number of free pages available at a particular page size.", but the osview man page doesn't seem to go into further detail.
In the real world I don't think anything except mad custom code deviates from the default page size :)
lewis wrote: ...mad custom code...
UNIX/IRIX = freedom! Gonna miss ya' old girl.