If you are the first time user of kSar, you can unzip it and start it in Linux by
# unzip kSar-5.0.6.zip
# cd kSar-5.0.6
# sh run.sh
It should able to start the GUI if the java is in your path. If it is not, you can set $JAVA_HOME first. E.g.:
# export JAVA_HOME=/usr/java/jdk1.5.0_08
# sh run.sh
And then you can try everything in the GUI.
But if you are a heavy user of kSar like me, you should learn this:
# sh run.sh -input /var/log/sa/sar13
And there are many others useful command line argument. You should have a look to them by:
# sh run.sh -help
A Linux Engineer who is working in Hong Kong. Interested in participating in some Open Source Software development for fun and programming practice. ;-)
Showing posts with label english. Show all posts
Showing posts with label english. Show all posts
Monday, June 8, 2009
Tuesday, June 2, 2009
ksar: a sar grapher
I use kSar for more then a year in my daily Linux support life. It is really useful (and saved my life for several times). But I haven't see much articles on web that talk about it. So I would like to write a simple introduction by myself.

kSar is a Java-based standalone application, which can read and graph the "sar" file generated by sar from Solaris, Linux, AIX and HP-UX system. Here are some advantage of kSar:
1. Multiple Platform
Because it is Java-based, it can run on many platforms (include Windows, but I have not tested). It is useful for me because I can study the sar files from whatever OS/platfrom on the platform I am using.
2. Dynamic graph + PDF export
It makes use of jfreechart library such that we can zoom-in the graph, while it can also output the graph in pdf, jpg, png and even csv format. It is useful for me to generate reports to customers. Moreover, you can add background (e.g. company logo) in the output graph.
3. Some useful extensions
It is open-source. And I have added several patch to add some common extended statistics on Linux system like "memused with buffer adjusted", stacked memory graph and system restarted marker (add in ksar-5.0.7).
4. Real time statistics
Other then reading existing sar file, it can get the output from command line or ssh command to display real time statistics.
5. Compare two graph
It can load two sar files and view it together for easy comparison, also you can compare two graph in the sar file.

I will talk about the usage of kSar soon.

kSar is a Java-based standalone application, which can read and graph the "sar" file generated by sar from Solaris, Linux, AIX and HP-UX system. Here are some advantage of kSar:
1. Multiple Platform
Because it is Java-based, it can run on many platforms (include Windows, but I have not tested). It is useful for me because I can study the sar files from whatever OS/platfrom on the platform I am using.
2. Dynamic graph + PDF export
It makes use of jfreechart library such that we can zoom-in the graph, while it can also output the graph in pdf, jpg, png and even csv format. It is useful for me to generate reports to customers. Moreover, you can add background (e.g. company logo) in the output graph.
3. Some useful extensions
It is open-source. And I have added several patch to add some common extended statistics on Linux system like "memused with buffer adjusted", stacked memory graph and system restarted marker (add in ksar-5.0.7).
4. Real time statistics
Other then reading existing sar file, it can get the output from command line or ssh command to display real time statistics.
5. Compare two graph
It can load two sar files and view it together for easy comparison, also you can compare two graph in the sar file.

I will talk about the usage of kSar soon.
Thursday, December 18, 2008
Restart Marker for kSar
I would like to propose a new feature to kSar. I called it "Restart Marker".
Actually the system reboot information is recorded by sar. It would be convenient to show it on kSar and the graph would be much clearer if the graph line is broken when the system restart. The left-end of the gap is the last record before the system restart. And the right-end of the gap is the first record after the system restart. And the time of the marker is the exact time that the system restart.


I have already completed the patch for Linux sar file. As I know, the sar file in other OS should have similar record too but I don't have them in hand. Would anyone please provide me such sar file with system restart record so that I can add this feature for other OS?
You can download the testing ksar here.
The patch for ksar-5.0.6 is here.
Actually the system reboot information is recorded by sar. It would be convenient to show it on kSar and the graph would be much clearer if the graph line is broken when the system restart. The left-end of the gap is the last record before the system restart. And the right-end of the gap is the first record after the system restart. And the time of the marker is the exact time that the system restart.


I have already completed the patch for Linux sar file. As I know, the sar file in other OS should have similar record too but I don't have them in hand. Would anyone please provide me such sar file with system restart record so that I can add this feature for other OS?
You can download the testing ksar here.
The patch for ksar-5.0.6 is here.
Wednesday, July 23, 2008
My favorite comic
PHD Comics is one of my favorite comics because it really showing both the interesting and boring academic life of the graduate students.
Monday, July 21, 2008
kSar Interrupt list
Here is my new patch for kSar: Interrupt list

It was a missing feature of kSar for Linux. And an option is also added to show it in the stacked way.
Sar would capture first 16 interrupts by default. The interrupts are identified by an number, which is known as IRQ. And you can check the mapping between IRQ and the device in /proc/interrupts on the system.
I don't think normal system admin need to investigate IRQ closely. I would like to add this feature mainly because of functional completeness. And it may be useful if you want to monitor the Interrupt rate or binding, for tuning for better system response time (e.g. for a Real time system). For more information about Interrupt binding, you can see here .
Here is the patch for kSar-4.0.14.
Here is the compiled jar with this feature as an option.

It was a missing feature of kSar for Linux. And an option is also added to show it in the stacked way.
Sar would capture first 16 interrupts by default. The interrupts are identified by an number, which is known as IRQ. And you can check the mapping between IRQ and the device in /proc/interrupts on the system.
I don't think normal system admin need to investigate IRQ closely. I would like to add this feature mainly because of functional completeness. And it may be useful if you want to monitor the Interrupt rate or binding, for tuning for better system response time (e.g. for a Real time system). For more information about Interrupt binding, you can see here .
Here is the patch for kSar-4.0.14.
Here is the compiled jar with this feature as an option.
Sunday, July 20, 2008
Gift Card
It is interesting that our company have an quite flexible encouraging mechanism "recognition reward". Everyone can nominate any other colleague (usually in another team or in another Geo) to have a reward because of his/her help on their work. The reward includes a paper certificate with our marketing souvenir for a help, or a USD50 gift card (Debt card) for a big help.
Recently I got a USD50 gift card because I help the customer services team to translate some Chinese customer email when their Chinese staff is on a trip.


Then the problem comes, how to spend the USD gift card in China? I think the company who can receive Visa card can use this. And my colleagues, who have received this card before, share that they can use this card in Super Market in China, like Walmart or Carrefour.
Reference:
Utopia de Fai: Reward
Recently I got a USD50 gift card because I help the customer services team to translate some Chinese customer email when their Chinese staff is on a trip.


Then the problem comes, how to spend the USD gift card in China? I think the company who can receive Visa card can use this. And my colleagues, who have received this card before, share that they can use this card in Super Market in China, like Walmart or Carrefour.
Reference:
Utopia de Fai: Reward
Thursday, June 26, 2008
Because it's fun
Recently I read an Paper written by Michael Tiemann, it quoted a survey result for the over 490,000 open source developers on sourceforge.com about the reason of involving in open source software:
When someone talk about Software Engineering, with troublesome documentation, processes and procedures... one will reply "well, I will do it because I know it is useful, I know I know..." but it is not fun at all. So people would do that as a job, as a part of their earn for living, without passion and motivation to improve it.
That's why open source is different. That's why people would like to spend their spare time to development software for free (Remember, people even willing to pay for fun!). That's why people in open source are full of passion and motivated. Because it's fun!
The three top reasons they list for their involvement is:It is interesting. Usually we mention that the contribution of open source software to the world and how meaningful it is. But people usually won't do something just because it is meaningful (i.e. only few people work for charity), people usually do something because it is fun. People even willing to pay for fun!
1. Because it's fun
2. Because it improves their skills
3. Because it is good for society
When someone talk about Software Engineering, with troublesome documentation, processes and procedures... one will reply "well, I will do it because I know it is useful, I know I know..." but it is not fun at all. So people would do that as a job, as a part of their earn for living, without passion and motivation to improve it.
That's why open source is different. That's why people would like to spend their spare time to development software for free (Remember, people even willing to pay for fun!). That's why people in open source are full of passion and motivated. Because it's fun!
Friday, June 20, 2008
Stacked memused on kSar
PS. My patch for memused (buffer adjusted) is accepted by kSar and released in kSar-4.0.14. Thank you for the developer Alexandre Cherif and all others support!
Here is my second patch for kSar: Stacked memory graph.

It added a new option to stack the following together into one graph:
Currently I just implemented this feature on Linux part of kSar. I am not sure if it is useful for other OS such as AIX, HPUX or Solaris. If someone think it is good to have this feature on other OS, please contact me and tell me how to "stack" the memory info of those OS. :-)
Here is the patch for kSar-4.0.14.
Here is the compiled jar with this feature as an option.
Here is my second patch for kSar: Stacked memory graph.

It added a new option to stack the following together into one graph:
- memused (buffer adjusted)
- buffers
- cached
- free
- swap used
Currently I just implemented this feature on Linux part of kSar. I am not sure if it is useful for other OS such as AIX, HPUX or Solaris. If someone think it is good to have this feature on other OS, please contact me and tell me how to "stack" the memory info of those OS. :-)
Here is the patch for kSar-4.0.14.
Here is the compiled jar with this feature as an option.
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
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
Tuesday, May 13, 2008
HP system clock problem
Someone reported that the system clock on a HP blade system running about 2 sec/hour faster then normal. I found this report:
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c01075682
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c01075682
Tuesday, March 25, 2008
An Antic Disposition: The Disharmony of OOXML
Interesting blog about the problem of OOXML.
An Antic Disposition: The Disharmony of OOXML: "I love the other distinguishing feature of your brief example - to which you did not alude:"
An Antic Disposition: The Disharmony of OOXML: "I love the other distinguishing feature of your brief example - to which you did not alude:"
Monday, March 17, 2008
Multi-core and Liunx Kernel
About Linux kernel scheduling on Multicore and hyperthread CPUs,describe the different behaviour of high performance and high power saving:
http://oss.intel.com/pdf/mclinux.pdf
But I have question, if I have multiple threads of a process which have dependent cache relationship, should they be put into the same Core domain?
(I think we can find the answer in Ulrich Drepper Paper about CPU cache.)
http://oss.intel.com/pdf/mclinux.pdf
But I have question, if I have multiple threads of a process which have dependent cache relationship, should they be put into the same Core domain?
(I think we can find the answer in Ulrich Drepper Paper about CPU cache.)
Subscribe to:
Posts (Atom)