我试图在Docker容器中运行应用程序构build并收集资源使用统计信息。
我可以通过检查在Ubuntu 14.04主机上运行docker的id foobar容器的示例内存使用情况详细信息来收集使用情况度量标准:
/sys/fs/cgroups/memory/docker/foobar/memory.stat
但在Centos 7主机上,“/ sys / fs / cgroups / memory / docker”目录缺失。
如何在Centos 7主机上find容器特定的内存或CPU使用情况。 谢谢
那么,首先你拼错cgroup
🙂
摸了摸之后,我发现你在找什么:
# cat /sys/fs/cgroup/memory/system.slice/docker-88018f8043d00669bbf865855ebc8a6ccc93a04ce588111e01d4e63739250340.scope/memory.stat cache 5251072 rss 380928 rss_huge 0 mapped_file 2662400 writeback 0 swap 0 pgpgin 1570 pgpgout 195 pgfault 344 pgmajfault 40 inactive_anon 278528 active_anon 102400 inactive_file 5083136 active_file 167936 unevictable 0 hierarchical_memory_limit 18446744073709551615 hierarchical_memsw_limit 18446744073709551615 total_cache 5251072 total_rss 380928 total_rss_huge 0 total_mapped_file 2662400 total_writeback 0 total_swap 0 total_pgpgin 1570 total_pgpgout 195 total_pgfault 344 total_pgmajfault 40 total_inactive_anon 278528 total_active_anon 102400 total_inactive_file 5083136 total_active_file 167936 total_unevictable 0 recent_rotated_anon 248 recent_rotated_file 41 recent_scanned_anon 248 recent_scanned_file 1495