The collection method of Docker related resource monitoring

Source: Internet
Author: User

===cpu_utilRead "/cgroup/cpuacct/docker/" +contain_id+ "/cpuacct.usage_percpu" in the binding core CPU usage time slice (cumulative value, Cpu_use_time), Cat/cgroup/cpuset/docker/b57b1f091f0b517499a74d5b36f23e7f001cac2ebc0639e85c291b41da04edcb/cpuset.cpus6-9 Cat/cgroup/cpuacct/docker/b57b1f091f0b517499a74d5b36f23e7f001cac2ebc0639e85c291b41da04edcb/cpuacct.usage_ Percpu0 0 0 0 0 0 66238344197440 70824963617248 74983569233356 78846644169639 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Read the total CPU time slice of the corresponding core in "/proc/stat" (cumulative value, Cpu_total_time) Cat/proc/statCPU 748602637 100253 642640755 59115027509 617404 62194 46746998 0 0......cpu6 5917531 581 3271039 937040243 7577 0 60604 0 0cpu7 5117588 239 2687069 938306300 5839 0 60538 0 0cpu8 5565280 2357 3584801 936739202 5650 0 60437 0 0cpu9 5295556 39 68 3496022 936905600 7601 0 59572 0 0 ... interval sampling, usage =cpu_use_time difference/cpu_total_time difference value ===memory.usage read "/cgroup/memory/ docker/"+contain_id+"/memory.stat "Active_anon and Inactive_anon Cat/cgroup/memory/docker/b57b1f091f0b517499a74d5b36f23e7f001cac2ebc0639e85c291b41da04edcb/memory.stat

Cache 2484948992
RSS 3240157184
Mapped_file 14901248
Pgpgin 2825935330
Pgpgout 2832891427
Swap 18874368
Inactive_anon 550154240
Active_anon 2690007040

...... Cat/cgroup/memory/docker/b57b1f091f0b517499a74d5b36f23e7f001cac2ebc0639e85c291b41da04edcb/memory.limit_in_ Bytes8589934592 usage = (active_anon+ Inactive_anon)/Allocated memory ===netio read +pid+/net/dev of "/proc/" In/out "bytes/packets" corresponding network card Cumulative value Cat/proc/11973/net/devinter-|   receive                                                  |   transmit face |bytes    packets errs drop fifo frame  compressed multicast|bytes    packets errs drop fifo colls  carrier compressed    lo: 369299212872 329498342     0    0    0     0           0         0  369299212872 329498342    0    0    0      0       0           0ns9a07c03c-2f: 262981028026 567054466    0    0     0     0          0          0 600088509350 658578900     0    0    0     0        0          0 interval sampling, rate = difference/sample interval  === Diskiols-l  /dev/mapper/docker-contain_id View the corresponding mounted disk ls-l/DEV/MAPPER/DOCKER-B57B1F091F0B517499A74D5B36F23E7F001CAC2EBC0639E85C291B41DA04EDCBlrwxrwxrwx 1 root root 7 February 16:57/dev/mapper/ DOCKER-B57B1F091F0B517499A74D5B36F23E7F001CAC2EBC0639E85C291B41DA04EDCB. /dm-1 read '/sys/block/' +device+ '/stat ' disk read/write bytes/count cumulative value, IO time Cat/sys/block/dm-1/stat2409 0 36434 5984 38847495 0 310779960 83760448 0 6256117 83778634 interval sampling, rate = difference/sampling interval, disk.util=i o Time/Sample interval ===tcp.connections statistics "/proc/" +pid+ "/net/tcp" and "/proc/" +pid+ "/NET/TCP6" connection in the established state of the number of connections, interval sampling ===load interval (5s) statistics The number of threads in "/cgroup/cpuacct/docker/" + contain_id + "/tasks" with a status of Running/disk-sleep/waiting, calculated as: Load = pre_load * MATH.EXP (- Interval/300) + cur_load * (1-math.exp (-time interval/300))

The collection method of Docker related resource monitoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.