Java Performance笔记

IPC: instructions per clock

CPI: cycles per instruction

 

1. 较高的内核/系统CPU使用率意味着程序可能有较激烈的资源竞争或者大量的IO交互。要尽可能地降低内核CPU占用率。

 

2. CPU utilization monitoring tools bundled with modern operating

systems report CPU utilization and do not report the percentage of CPU clock cycles
the CPU has been executing instructions. This means that the operating system tools
report a CPU as being utilized even though the CPU may be waiting for data to be
fetched from memory. This scenario is commonly referred to as a stall. Stalls occur
any time the CPU executes an instruction and the data being operated on by the
instruction is not readily available in a CPU register or cache.

 

3. Windows下监控性能的工具有perfmon和typeperf。Linux下有http://teasp.iteye.com/admin/blogs/1940837

 

4. A general guideline to follow is observing run queue depths over an extended
period of time greater than 1 times the number of virtual processors is something to
be concerned about but may not require urgent action. Run queue depths at 3 to 4
times, or greater, than the number of virtual processors over an extended time period
should be considered an observation that requires immediate attention or action.

 

5. A Java application or JVM that is swapping or utilizing virtual memory experiences
pronounced performance issues...The time it takes to page in any portion of the Java heap into memory can
dramatically increase the duration of a garbage collection.

 

6. 在Linux上安装小巧的sysstat可以得到这些:sar, iostat, sa1, sa2, sadf, mpstat, sadc, sysstat

 

7. 用pidstat可以查看进程主动和被动上下文切换的频率:cswch/s(主动) nvcswch/s(被动),这两者的值乘以80000就是上下文切换消耗掉的时钟周期。

 

8. nicstat(要安装)可以查看网络传输利用率,netstat只能知道单位时间传输的包数,而不能统计包的大小。

 

9. 用iostat -xm可以看磁盘IO使用率。

 

10. sar是个好工具。

你可能感兴趣的:(performance)