美文网首页
Linux中部署docker容器,docker stats命令源

Linux中部署docker容器,docker stats命令源

作者: EamonXia | 来源:发表于2018-12-25 21:54 被阅读0次
/proc/stat

kernel/system statistics. Varies with architecture. Common
entries include:
内核/系统的统计资料,会随着架构而变化,普通的条目如下所示:

cpu 10132153 290696 3084719 46828483 16683 0 25195 0 175628 0
cpu0 1393280 32966 572056 13343292 6130 0 17875 0 23933 0
                     The amount of time, measured in units of USER_HZ
                     (1/100ths of a second on most architectures, use
                     sysconf(_SC_CLK_TCK) to obtain the right value), that
                     the system ("cpu" line) or the specific CPU ("cpuN"
                     line) spent in various states:

表示的是时间,使用的计量单位为USER_HZ(绝大部分架构中是百分之一秒,可以使用sysconf(_SC_CLK_TCK)来获取其值),"cpu"行或者特定的"cpuN"行,表示该CPU在不同的状态下所花费的时间:

                     user   (1) Time spent in user mode.
                                用户态下花费的时间
                     nice   (2) Time spent in user mode with low priority
                            (nice).
                               在低优先级用户态上花费的时间
                     system (3) Time spent in system mode.
                               在内核态上花费的时间
                     
                     idle   (4) Time spent in the idle task.  This value
                            should be USER_HZ times the second entry in the
                            /proc/uptime pseudo-file.
                           在idle task上花费的时间,这个值应该等于USER_HZ
                           乘以伪文件/proc/uptime中的第二条
                     
                    iowait (since Linux 2.5.41)
                            (5) Time waiting for I/O to complete.  This
                            value is not reliable, for the following rea‐
                            sons:
                            等待I/O的时间,这个时间基于以下原因是不大可靠的                             

                            1. The CPU will not wait for I/O to complete;
                               iowait is the time that a task is waiting for
                               I/O to complete.  When a CPU goes into idle
                               state for outstanding task I/O, another task
                               will be scheduled on this CPU.
                            1.CPU并不会等待I/O完成,iowait是task等待I/O完成的时间,
                             当一个CPU进入一个明显的task I/O,另一个task将会被CPU调度                            

                            2. On a multi-core CPU, the task waiting for I/O
                               to complete is not running on any CPU, so the
                               iowait of each CPU is difficult to calculate.
                            2.在一个多核系统中,task等待I/O完成时,并没有在任何
                              CPU上运行,所以很难计算每个CPU的iowait                          

                            3. The value in this field may decrease in cer‐
                               tain conditions.
                               在某些情况下,这个字段的值可能会减少
                     
                    irq (since Linux 2.6.0-test4)
                            (6) Time servicing interrupts.
                                  中断时间

                     softirq (since Linux 2.6.0-test4)
                            (7) Time servicing softirqs.
                                 软中断时间                                

                     steal (since Linux 2.6.11)
                            (8) Stolen time, which is the time spent in
                            other operating systems when running in a virtu‐
                            alized environment
                            被偷走的时间,就是当安装了一个虚拟的环境,运行其他
                            操作系统的的时间                           


                     guest (since Linux 2.6.24)
                            (9) Time spent running a virtual CPU for guest
                            operating systems under the control of the Linux
                            kernel.
                            一个虚拟的CPU
                            在Linux内核控制下,运行一个guest operating systems
                            的时间                           

                     guest_nice (since Linux 2.6.33)
                            (10) Time spent running a niced guest (virtual
                            CPU for guest operating systems under the con‐
                            trol of the Linux kernel).
                            运行一个niced guest的时间        
     
              page 5741 1808
                     The number of pages the system paged in and the number
                     that were paged out (from disk).

              swap 1 0
                     The number of swap pages that have been brought in and
                     out.

              intr 1462898
                     This line shows counts of interrupts serviced since
                     boot time, for each of the possible system interrupts.
                     The first column is the total of all interrupts ser‐
                     viced including unnumbered architecture specific inter‐
                     rupts; each subsequent column is the total for that
                     particular numbered interrupt.  Unnumbered interrupts
                     are not shown, only summed into the total.

              disk_io: (2,0):(31,30,5764,1,2) (3,0):...
                     (major,disk_idx):(noinfo, read_io_ops, blks_read,
                     write_io_ops, blks_written)
                     (Linux 2.4 only)

              ctxt 115315
                     The number of context switches that the system under‐
                     went.

              btime 769041601
                     boot time, in seconds since the Epoch, 1970-01-01
                     00:00:00 +0000 (UTC).

              processes 86031
                     Number of forks since boot.

              procs_running 6
                     Number of processes in runnable state.  (Linux 2.5.45
                     onward.)

              procs_blocked 2
                     Number of processes blocked waiting for I/O to com‐
                     plete.  (Linux 2.5.45 onward.)

              softirq 229245889 94 60001584 13619 5175704 2471304 28
              51212741 59130143 0 51240672
                     This line shows the number of softirq for all CPUs.
                     The first column is the total of all softirqs and each
                     subsequent column is the total for particular softirq.
                     (Linux 2.6.31 onward.)
参看文献:

Docker CPU Usage
https://xiezhenye.com/2013/10/%E7%94%A8-cgroups-%E7%AE%A1%E7%90%86-cpu-%E8%B5%84%E6%BA%90.html
https://www.cnblogs.com/ohgenlong/p/8605896.html

相关文章

网友评论

      本文标题:Linux中部署docker容器,docker stats命令源

      本文链接:https://www.haomeiwen.com/subject/xnwakqtx.html