zoukankan      html  css  js  c++  java
  • 查看上下文切换的多的进程(find which process take the most context switch)

    这是原文链接http://serverfault.com/questions/190049/find-out-which-task-is-generating-a-lot-of-context-switches-on-linux

    主要就是用pidstat -w 查看上下文切换,

    root@wis-virtual-machine:~# pidstat -w 1
    Linux 4.2.0-16-generic (wis-virtual-machine)    2016年04月08日  _i686_  (1 CPU)
     
    10时19分27秒   UID       PID   cswch/s nvcswch/s  Command
    10时19分28秒     0         3      3.88      0.00  ksoftirqd/0
    10时19分28秒     0         7     13.59      0.00  rcu_sched
    10时19分28秒     0        10      0.97      0.00  watchdog/0
    10时19分28秒     0       833      7.77      0.00  Xorg
    10时19分28秒  1000      1564      6.80      7.77  compiz

    -t选项可以查看进程下面进程的。

    root@wis-virtual-machine:~# pidstat -w -t
    Linux 4.2.0-16-generic (wis-virtual-machine) 2016年04月19日 _i686_ (1 CPU)

    08时34分24秒 UID TGID TID cswch/s nvcswch/s Command
    08时34分24秒 0 1 - 1.63 1.39 systemd
    08时34分24秒 0 - 1 1.63 1.39 |__systemd
    08时34分24秒 0 2 - 0.32 0.00 kthreadd
    08时34分24秒 0 - 2 0.32 0.00 |__kthreadd
    08时34分24秒 0 3 - 3.00 0.01 ksoftirqd/0
    08时34分24秒 0 - 3 3.00 0.01 |__ksoftirqd/0

    查看数据的时候还有个watch命令,大家也可以man一下看看,(watch -tdn0.5 pidstat -w)

  • 相关阅读:
    异常处理基本语法
    数字取舍(trunc round ceil floor)
    关于union的理解
    SQL Loader 导入EXCEL 数据到ORACLE 数据库
    临时表的使用方法
    对外投资
    存货盘盈盘亏核算
    现金流量表补充资料的编制公式
    会计科目的具体定义
    中英文职位对照之 会计与财务
  • 原文地址:https://www.cnblogs.com/WisWang/p/5406791.html
Copyright © 2011-2022 走看看