Single CPU always at 100%, lagging | Ubuntu 18.04.4

Solution 1:

You could try one or few of:

  • Use htop to see what processes load your system and kill them to see what will happen: killall processname or killall -9 processname to kill it forcefully.
  • Reinstall a package of a program or command that loads it intensively by: sudo apt purge package_name && sudo apt autoremove && sudo apt install package_name
  • Update/Install CPU mocrocode firmware: sudo apt update && sudo apt install intel-microcode microcode.ctl
  • Install a different kernel and try it
  • Install a different desktop manager: gdm3 instead of lightdm or vice versa, purging previous: sudo apt install gdm3 && sudo apt purge lightdm
  • Install a different desktop environment: sudo apt install lubuntu-desktop and try it.
  • Purge xubuntu-desktop or xfce4 as I was noticing that system lags when it is installed, however, not used: sudo apt purge xubuntu-desktop && sudo apt purge xfce*

My pstree -l on 19.10 with gdm3:

├─gdm3─┬─gdm-session-wor─┬─gdm-x-session─┬─Xorg───{Xorg}
│      │                 │               ├─gnome-session-b───3*[{gnome-session-b}]
│      │                 │               └─2*[{gdm-x-session}]
│      │                 └─2*[{gdm-session-wor}]
│      ├─gdm-session-wor─┬─gdm-x-session─┬─Xorg───{Xorg}
│      │                 │               ├─gnome-session-b─┬─ssh-agent
│      │                 │               │                 └─2*[{gnome-session-b}]
│      │                 │               └─2*[{gdm-x-session}]
│      │                 └─2*[{gdm-session-wor}]
│      └─2*[{gdm3}]

My pstree -l on 18.04 VM:

├─lightdm─┬─Xorg───5*[{Xorg}]
│         ├─lightdm─┬─lxsession─┬─lxpanel─┬─lxterminal─┬─bash───pstree
│         │         │           │         │            ├─bash
│         │         │           │         │            └─2*[{lxterminal}]
│         │         │           │         └─4*[{lxpanel}]
│         │         │           ├─lxpolkit───2*[{lxpolkit}]
│         │         │           ├─openbox───2*[{openbox}]
│         │         │           ├─pcmanfm───2*[{pcmanfm}]
│         │         │           ├─ssh-agent
│         │         │           └─2*[{lxsession}]
│         │         └─2*[{lightdm}]
│         └─2*[{lightdm}]

Run also journalctl -f in a terminal to see what happens. Maybe some gnome-settings-daemon (gsd) constantly trying to do something and fails throwing errors and it takes the whole core.

Switch to lightdm to see if something will be changed, but do it on some tty: Alt+Ctrl+F3: sudo apt purge gdm3 && sudo apt install lightdm. You could also do it without gdm3 removing: sudo dpkg-reconfigure lightdm if you have it installed.

sudo dpkg-reconfigure lightdm
reboot
sudo dpkg-reconfigure gdm3

Maybe switching to lightdm fourth and to gdm3 back somehow changes gdm3 configuration modified previously by different graphical configuration tools.