linux performance monitoring

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值