hishamhm / htop

htop is an interactive text-mode process viewer for Unix systems. It aims to be a better 'top'.
GNU General Public License v2.0
5.84k stars 581 forks source link

Ubuntu htop, in LXC, showing always 100% CPU usage #936

Open Power2All opened 5 years ago

Power2All commented 5 years ago

htop is showing wrong CPU usages, comparing to "top" in Ubuntu. Environment is Proxmox (Debian), with LXC containers. I think the way htop calculates or get it's CPU usage, might be broken or wrong on LXC environment somehow.

htop screenshot:

image

However, top shows whole different story:

image

lucsoft commented 4 years ago

dude you are using 100%

Power2All commented 4 years ago

dude you are using 100%

Host machine and TOP says something else Look at the 1% usage. It says 100% CPU, but in fact it isn't. The proxmox load monitoring shows also a much lower CPU usage, so no, the htop stats are wrong.

lucsoft commented 4 years ago

are you in a container or something?

Power2All commented 4 years ago

are you in a container or something?

Yes, but I solved the issue. Had to modify to proc usage. Some people mentioned it on google as well, that some proc readouts were wrong, and could be disabled being parsed. htop shows proper CPU usage again.

hortigosa commented 4 years ago

@Power2All How did you modify it ? We're having the same issue.

atipaHy commented 4 years ago

@hortigosa did you solve it?

Power2All commented 4 years ago

@hortigosa It has to do with the format encoding of the terminal. When it's not correctly set, it will corrupt the output data.

iandk commented 4 years ago

@Power2All Do you have some more information? I have the same problem with the LXC Debian 10 template.

iandk commented 4 years ago

@atipaHy @hortigosa try the following:

locale-gen en_US.UTF-8

export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 locale-gen en_US.UTF-8 dpkg-reconfigure locales

reboot

atipaHy commented 4 years ago

@atipaHy @hortigosa try the following:

locale-gen en_US.UTF-8

export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 locale-gen en_US.UTF-8 dpkg-reconfigure locales

reboot

@iandk solved it. Thanks