docker stats
显示cpu的使用率很高。但是top
命令显示未使用88.3%的cpu。容器内部是一个Java服务httpthrift服务。
docker stats :
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
8a0488xxxx5 540.9% 41.99 GiB / 44 GiB 95.43% 0 B / 0 B 0 B / 35.2 MB 286
最高输出:
top - 07:56:58 up 2 days, 22:29, 0 users, load average: 2.88, 3.01, 3.05
Tasks: 13 total, 1 running, 12 sleeping, 0 stopped, 0 zombie
%Cpu(s): 8.2 us, 2.7 sy, 0.0 ni, 88.3 id, 0.0 wa, 0.0 hi, 0.9 si, 0.0 st
KiB Mem: 65959920 total, 47983628 used, 17976292 free, 357632 buffers
KiB Swap: 7999484 total, 0 used, 7999484 free. 2788868 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8823 root 20 0 58.950g 0.041t 21080 S 540.9 66.5 16716:32 java
如何减少cpu的使用率并将其控制在100%以下?
最佳答案
根据top man page:
When operating in Solaris mode (`I' toggled Off), a task's cpu usage will be divided by the total number of CPUs. After issuing this command, you'll be told the new state of this toggle.
因此,在交互模式下使用top时,通过按
I
键,您将切换到Solaris模式,CPU使用率除以CPU(或内核)总数。附注:此选项并非在所有版本的top中都可用。
关于docker - 了解Docker容器cpu的用法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60259135/