天天看點

In vmstat output, what does blocked process mean ( b = 1 ) ?

​​

環境

  • Red Hat Enterprise Linux

問題

  • In ​

    ​vmstat​

    ​ output analysis - In the "b" column, there is often a blocked process when there is no runnable process (b=1, r=0):
procs ---------memory---------- ..--io-- --system-- -----cpu------
  r b swpd   free   buff     cache.. bi   bo   in   cs us sy id wa st
  4 0  584 353356 253400 113705408..  2    7    1    1  1  0 99  0  0
  0 0  584 370396 253488 113686320..213 1768 1479 9980  2  1 97  0  0
  1 1  584 372116 253548 113686464..  0  102 1363 5944  1  0 99  0  0
  1 0  584 363424 253592 113694160..  0  902 1419 10058 2  1 97  0  0
  1 1  584 363084 253652 113694248..  0  916 1629 7889  3  0 97  0  0
  0 1  584 354056 253724 113701984.. 18  877 1551 9900  3  1 96  0  0
  0 1  584 352184 253792 113702256.. 26 1126 1494 6634  1  0 98  0  0
  3 0  584 370772 253852 113682080..  0  826 1419 9887  2  1 97  0  0
  0 1  584 371656 253920 113682160..  0 1032 1471 6691  1  0 99  0  0
  1 0  584 363232 253964 113689544..  0  822 1403 8909  1  1 97  0  0
  0 1  584 363684 254012 113689904..  0  954 1384 6119  1  0 99  0  0
  1 0  584 353920 254060 113697632..  0  846 1394 9668  2  2 96  0  0
  0 1  584 354168 254120 113697712..  0  927 1449 5809  1  0 99  0  0
  1 0  584 373448 254168 113677552..  0  829 1493 9389  2  1 97  0  0
  0 1  584 373964 254240 113677632..  0  970 1414 5998  1  0 98  0  0;
  2 0  584 363684 254304 113685360..  6 1651 1439 8446  2  1 96  1  0
  0 1  584 364836 254380 113685424..  0  182 1389 6240  2  1 97  0  0
  1 0  584 354992 254436 113692976..  0 1102 1308 9352  1  1 98  0  0
  0 1  584 355396 254500 113693168..  0  632 1400 4912  1  0 98  0  0
  1 0  584 346056 254564 113700600..  0  862 1426 9563  2  1 97  0  0
  0 1  584 374380 254636 113673032..  0  929 1339 5116  1  0 99  0  0
      
  • If there are no running processes, then what is the blocked process blocked on?

決議

  • The blocked process ( b = 1 ) means the task is 'blocked' (or 'uninterruptible' or in 'deep sleep') when it is waiting for some event (mostly IO work to finish). So for example when task asks to read data from disk it will change it's state to "blocked" as it waits for receiving the data. The task cannot run on before it gets the data and if there is not any other task to run at that moment, running processes could be zero.
  • This is completely normal behavior intended by design.

繼續閱讀