linux performance monitoring
2015-09-14 13:53
666 查看
Linux Performance Monitoring
CPU:
You should understand the four critical performance metrics for CPU — context switch, run queue, cpu utilization, and load average.
Context Switch
When CPU switches from one process (or thread) to another, it is called as context switch.
When a process switch happens, kernel stores the current state of the CPU (of a process or thread) in the memory.
Kernel also retrieves the previously stored state (of a process or thread) from the memory and puts it in the CPU.
Context switching is very essential for multitasking of the CPU.
However, a higher level of context switching can cause performance issues.
Run Queue:
Run queue indicates the total number of active processes in the current queue for CPU.
When CPU is ready to execute a process, it picks it up from the run queue based on the priority of the process.
Please note that processes that are in sleep state, or i/o wait state are not in the run queue.
So, a higher number of processes in the run queue can cause performance issues.
Cpu Utilization
This indicates how much of the CPU is currently getting used.
This is fairly straight forward, and you can view the CPU utilization from the top command.
100% CPU utilization means the system is fully loaded.
So, a higher %age of CPU utilization will cause performance issues.
Load Average
This indicates the average CPU load over a specific time period.
On Linux, load average is displayed for the last 1 minute, 5 minutes, and 15 minutes.
4000
This is helpful to see whether the overall load on the system is going up or down.
Please note that this load average is calculated by combining both the total number of process in the queue, and the total number of processes in the uninterruptable task status.
Network:
For network interfaces, you should monitor total number of packets (and bytes) received/sent through the interface, number of packets dropped, etc.,
I/O
I/O wait is the amount of time CPU is waiting for I/O. If you see consistent high i/o wait on you system, it indicates a problem in the disk subsystem.
reads/second, and writes/second are measured in blocks. i.e number of blocks read/write per second. These are also referred as bi and bo (block in and block out).
tps indicates total transactions per seconds, which is sum of rtps (read transactions per second) and wtps (write transactions per seconds).
Memory
Virtual memory = Swap space available on the disk + Physical memory. The virtual memory contains both user space and kernel space.
The unused RAM will be used as file system cache by the kernel.
The Linux system will swap when it needs more memory. When it swaps, it writes the least used memory pages from the physical memory to the swap space on the disk.
Lot of swapping can cause performance issues, as the disk is much slower than the physical memory, and it takes time to swap the memory pages from RAM to disk.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CPU:
You should understand the four critical performance metrics for CPU — context switch, run queue, cpu utilization, and load average.
Context Switch
When CPU switches from one process (or thread) to another, it is called as context switch.
When a process switch happens, kernel stores the current state of the CPU (of a process or thread) in the memory.
Kernel also retrieves the previously stored state (of a process or thread) from the memory and puts it in the CPU.
Context switching is very essential for multitasking of the CPU.
However, a higher level of context switching can cause performance issues.
Run Queue:
Run queue indicates the total number of active processes in the current queue for CPU.
When CPU is ready to execute a process, it picks it up from the run queue based on the priority of the process.
Please note that processes that are in sleep state, or i/o wait state are not in the run queue.
So, a higher number of processes in the run queue can cause performance issues.
Cpu Utilization
This indicates how much of the CPU is currently getting used.
This is fairly straight forward, and you can view the CPU utilization from the top command.
100% CPU utilization means the system is fully loaded.
So, a higher %age of CPU utilization will cause performance issues.
Load Average
This indicates the average CPU load over a specific time period.
On Linux, load average is displayed for the last 1 minute, 5 minutes, and 15 minutes.
4000
This is helpful to see whether the overall load on the system is going up or down.
Please note that this load average is calculated by combining both the total number of process in the queue, and the total number of processes in the uninterruptable task status.
Network:
For network interfaces, you should monitor total number of packets (and bytes) received/sent through the interface, number of packets dropped, etc.,
I/O
I/O wait is the amount of time CPU is waiting for I/O. If you see consistent high i/o wait on you system, it indicates a problem in the disk subsystem.
reads/second, and writes/second are measured in blocks. i.e number of blocks read/write per second. These are also referred as bi and bo (block in and block out).
tps indicates total transactions per seconds, which is sum of rtps (read transactions per second) and wtps (write transactions per seconds).
Memory
Virtual memory = Swap space available on the disk + Physical memory. The virtual memory contains both user space and kernel space.
The unused RAM will be used as file system cache by the kernel.
The Linux system will swap when it needs more memory. When it swaps, it writes the least used memory pages from the physical memory to the swap space on the disk.
Lot of swapping can cause performance issues, as the disk is much slower than the physical memory, and it takes time to swap the memory pages from RAM to disk.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
相关文章推荐
- Linux socket 初步
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Yaconf 1.1.0 - 40%速度提升版
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- 基于 Linux 集群环境上 GPFS 的问题诊断
- 谁是桌面王者?Win PK Linux三大镇山之宝
- vivi下重新调整分区
- Linux VS Unix:Linux欲一统天下 Unix不死
- linux下设定环境变量