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.

Thursday, August 21, 2008

制度與發展

工作了幾年,見過不同公司、不同部門、還有不同地方的管理之後,我開始覺得:一間公司,能有一個相對來說比較能motivate人的制度,就已經很不錯了。因為一間公司的制度,很多時候都會受很多能想到的或意想不到東西影響,例如公司文化,歷史,人事關係,或者只是當權者的好惡等等。受這些因素影響下的制度,很多時不能合理地motivate人,或是把人motivate到不productive的方向去了。

例如:如果一間公司的情況是拍馬屁就能升職加薪,就會把大家motivate去努力拍馬屁,而不是做好工作。

在wikipedia中看到一段有趣的歷史:

鄧小平的另一大成就是恢復了全國大學統一入學考試,即高考。自從1977年恢復高考,31年中,它是中國被最公正公平執行的大學招生制度。高考讓中國大批有能青年有了獲得普遍承認的機會,讓廣大貧困家庭有了另一個改變命運的途徑。當今一些學者認為,鄧小平的理念是,推進科學化的同時推進民主化進程。

(Ref. http://zh.wikipedia.org/w/index.php?title=邓小平&variant=zh-tw)

對香港人來說,考試已經是生命中的一部分,考試中的不公平永遠都是可以批評的話題。但是再看看沒有高考前的中國,就知道為什麼說高考是“中國被最公正公平執行的大學招生制度”:

全國普通高等學校招生入學考試

歷史

高考于1955年設立,在1966年開始的文化大革命期 間被中斷。文革時期,上大學的資格很大程度上由家庭背景而定。全中國實施「自願報名,群眾推薦,領導批准,學校複審」的方法招收具有兩年以上實踐經驗、初 中以上文化程度的工、農、兵上大學。「工農兵學員」上大學的主要任務不是學習,而是「上大學、管大學、用毛澤東思想改造大學」,簡稱「上、管、改」。高考 的廢除破壞了中國十一年的發展教育事業,耽誤了一代人的前程,對中國文明、經濟、生產力與國力的發展造成了嚴重的阻礙。1976年毛澤東去世以後,文化大革命結束,鄧小平上任並恢復了全國高考。

(Ref. http://zh.wikipedia.org/w/index.php?title=全国普通高等学校招生入学考试&variant=zh-tw)

Saturday, August 2, 2008

北京新景象

臨近北京奧運,雖然我覺得北京的奧運氣氛沒有傳媒說得這麼熱烈,但是變化還是有的:

這是北京首都機場的三號航站樓,挺漂亮的,格局有點像香港機場的。(還是所有新建的機場都是一個格局?)

我公司對面的CCTV新大樓,我是看著它起的。有點後悔沒有每天拍一張照片然後合起來成為一個video。
對市民有最大幫助的一定是新建的地鐡線路了。這些照片是在新開的十號線拍的。十號線從西北面的中關村一帶,沿三環往東到三元橋,再往南通過國貿一帶。可以說是連接兩大商業區(中關村一帶和國貿CBD)的重要交通工具。從前兩個區之間的交通非常繁忙,如果你要由北面到CBD,或者由東面到中關村,最少要花一個多小時在車上,現在卻是非常方便。有個同事說從北面的回龍觀到公司,坐十號線省了半個小時,現在可以到KFC吃個早餐才上班。(這讓我想起80年代末香港"搭地下鐵路,話咁快就到"那種廣告。)

還有就是最近的單雙號行車,也對空氣真的有點幫助。照片中那種晴空的感覺,平常只有下雨後才會有一天,第二天又恢復原狀了。但是最近一個星期都能保持這樣的空氣質素。真的讓整個北京都心曠神怡。


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.

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

中國特色雪糕

生活在中國內地,每天都會見到不少有中國內地特色的事情。

今天在超市看到一款中國有名的雪糕品牌出的“三條裝”雪條:


有沒有發現有什麼特別?三條裝的雪條是兩大一小的。再看看價錢牌上說明這是“家庭裝”。香港的“家庭裝”東西一般是四件包裝的,但大陸的一孩政策下,家庭一般是兩大一小,公司這樣的包裝也真夠體貼。

伸延閱讀:
《家有儿女》的平常幸福已不平常

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:
The three top reasons they list for their involvement is:
1. Because it's fun
2. Because it improves their skills
3. Because it is good for society
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!

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:
  • memused (buffer adjusted)
  • buffers
  • cached
  • free
  • swap used
When all these information are plotted in different graphs, they all have different scale. It is good if you just want to view particular piece of information, but it is difficult for comparison. Sometimes it would be misleading that a large fluctuation on one graph actually mean a change in range of a few kbytes, which is just a small ripple on another 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.

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

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

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:"

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.)