Friday, May 23, 2008

kSar and Memory used (buffer adjusted)

Recently I found a sar graphing tool that I dreamed for more then a year: kSar

It is really a good tool that can view the sar output and export it to PNG or PDF. Really useful for me to do system status reporting for my customers.

And I can't help myself to add my dream feature to it. Here is the first one: Memory used (buffer adjusted).



In Linux system, the "memory used" value in sar (and also other tools like free) included the (1) memory used by the applications AND (2) the memory used by buffer and cache. Part 1 is usually sysadmin concern about. Part 2 is handled by the kernel automatically and it will be freed if the Part 1 increase. So in some tools like free, they will calculate a "buffer adjusted" by memused - cached - buffers. (For more information, see here or the man page of free)

This is one of the most common FAQ and I have to do the calculation on the sar data every time I want to the memory used by application. That's why I create such a patch for kSar.

Here is the patch for kSar-4.0.10: http://johnlcf.googlepages.com/kSar-4.0.10_bufferadj.patch
Here is the compiled kSar.jar with this feature as an option: http://johnlcf.googlepages.com/kSar.jar

7 comments:

Ryan said...

Hey John,

This is a great idea. Unfortunately, I don't see it in the latest version of kSar, 5.0.7. Is it still in there? How do we find this graph in kSar? When I click on the "Memory Misc" chart it only shows "buffers" and "cached".

Thanks!

Ryan said...

Spoke too soon... found it in the GUI's "Options" menu.

I can't seem to figure out how to do it from the command-line, which is what I was really trying to do. Any idea?

Thanks!

John Lau said...

I think the command line option is not added. I may submit a another patch for that later.

(Personally I think there is too much command line options for kSar. Some of them should be grouped into a configure file or something else.)

Rachna...... said...

have you submitted patch that includes command line option for memory used buffer adjusted? If so please let me know which version has it.

Thanks a ton. Ksar is great help in my project work!!

John Lau said...

Sorry I haven't work on it and I haven't involved in the project for a long time. I suggest you to contact the current maintainer.

David belton said...

123.hp.com/oj3830

danielhavery said...

Epson XP 960