Score:0

Ubuntu Slow and Unresponsive. Terminal takes about 20 seconds to load

sa flag

This is Magma, I have been having issues with my Ubuntu system right from the instance I installed it.

My laptop Specifications are:

Processor: i7 9750h

GPU: 1660ti

Ram: 8 GB

Hard Disk 1 TB out of which 100 GB is for ubuntu Root + Home.

iGPU - Intel 630HD

I have installed the Proprietary GPU drivers since they allow me to switch between the iGPU and regular GPU.

Problem:

  • Windows are laggy.

  • Applications take a long time to open.

  • UI is unresponsive.

  • Switching between tasks is a pain.

  • Randomly laptop heats up.

  • Booting takes a long time.

  • After entering my password, the booting might take upwards if a minute.

Previous suggestions: Badblocks test. Reinstalling Graphics drivers.

I just want to use my Ubuntu on my laptop as my daily driver.

What I need:

  • Smoother and if possible instant switching between iGPU and normal GPU.

  • Solutions to all the above problem.

  • I have used Communitheme so love the look and feel of my laptop.

See if you can help me out. Thank you !

Output of the command ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head: https://ibb.co/VVV9HCF

Output of ls -al ~/.local/share/gnome-shell/extensions

total 16
drwxrwxr-x 4 username username 4096 Mar  8  2020 .
drwx------ 4 username username 4096 Jun  7 21:48 ..
drwxrwxr-x 5 username username 4096 Oct  6  2020 [email protected]
drwxrwxr-x 4 username username 4096 Jan 25 20:28 [email protected]

Output of ls -al /usr/share/gnome-shell/extensions

total 20
drwxr-xr-x 5 root root 4096 Aug 26  2020 .
drwxr-xr-x 7 root root 4096 Apr 15 09:17 ..
drwxr-xr-x 2 root root 4096 Aug 26  2020 desktop-icons@csoriano
drwxr-xr-x 3 root root 4096 May  5 17:04 [email protected]
drwxr-xr-x 3 root root 4096 Nov 27  2020 [email protected]

gnome-shell takes anywhere from 1 to 3 % memory when no mouse / keyboard movements.

MagmaCodes avatar
sa flag
I get you but I have Lubuntu running on my decade old machine with much older read write speed HDD works blazing fast. That machine just has 4gb ram and 1gb gpu.
blnks avatar
mw flag
This is not normal. Run `ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head` in terminal. It shows you which process is the culprit.
MagmaCodes avatar
sa flag
Thanks, before running it, can you please tell me if this is Destructible / Has chance of messing my system up. Asking because last time someone told me to do Badblocks and I didn't know that it was harmful. Thankfully an expert told me to do it but with the correct flags. Edit: On the basis of my research PS seems non destructive.
MagmaCodes avatar
sa flag
Here is the output of the command you asked me to run: https://ibb.co/VVV9HCF
heynnema avatar
ru flag
It certainly looks like vivaldi is sucking up a lot of CPU, however, edit your question and show me `free -h` and `swapon -s` and `top`. Start comments to me with @heynnema or I'll miss them.
MagmaCodes avatar
sa flag
@heynnema `top` output: https://ibb.co/rp5ZHNK `free -h` output: https://ibb.co/nnG1gy0 `swapon -s` output: https://ibb.co/Tw7MDRY. BTW I checked your profile and you are the same person who replied to me last time, thanks for that !
MagmaCodes avatar
sa flag
Also, I don't know what to edit in the question.
heynnema avatar
ru flag
Thanks for that data. Do the `top` command again, and with no keyboard/mouse movement, tell me what CPU% gnome-shell is taking. It should be < 4% at idle. Edit your question and show me `ls -al ~/.local/share/gnome-shell/extensions` and `ls -al /usr/share/gnome-shell/extensions`. Just edit your question and paste in that output, select the pasted text, and click the {} icon to format it.
MagmaCodes avatar
sa flag
@heynnema made the changes in the question itself. Thanks !
heynnema avatar
ru flag
Log into a different user account (create on if you need to) and see if the problem also occurs there.
MagmaCodes avatar
sa flag
Yes, will do this and respond in a few hours.
MagmaCodes avatar
sa flag
@heynnema I created a new account and logged into it. This seems much smoother than my normal account. Terminal starts instantly and the windows are not that laggy. So if I uninstall all my UI upgrades done on my main account, will I be able to retain this level of performance ? Also I had installed Kubuntu Desktop since I thought unity was the culprit. Now I need to uninstall all of them as well.
heynnema avatar
ru flag
@MagmaCodes Please see my answer. If it helps to solve the problem, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
Score:0
ru flag

We've proven that logging into a different user account solves the problem. This isolates the problem to something in your normal user account.

Rather than performing massive software uninstalls, we'll try a more targeted surgical approach.

There are three critical folders in your /home directory that can cause problems... .cache, .config, and .local.

We'll start with .cache...

  • rename the .cache folder to .cache.HOLD
  • IMMEDIATELY log out
  • log in
  • a new .cache folder got recreated at log in time
  • see if the problem is resolved
  • if it is resolved, then something in the .cache.HOLD folder was causing the problem
    • move items from .cache.HOLD folder back into the new .cache folder...
    • BUT DO NOT REPLACE EXISTING ITEMS in the new .cache folder.
  • if it is not resolved, then the .cache.HOLD folder is not the culprit, and we need to put it bacK
    • to restore the original .cache folder...
    • rename .cache to .cache.NEW
    • rename .cache.HOLD to .cache
    • IMMEDIATELY log out
    • log in
    • move/delete the .cache.NEW folder
    • consult with me for the next steps... (.local, then .config)
MagmaCodes avatar
sa flag
I can say that .cache is not the issue. I copied all the files that I could into the new folder. Many files were read only so could not copy those. Things were smooth. Made the old cache as the new and the things are same. I do want to add, When I logged into the new instance I realized that KDE might be bloating things up. I uninstalled KDE Desktop environment totally and that has improved my OS speed as well. Edit: After an hour, the terminal takes 7-8 seconds to load once then loads instantly if a new one is opened. But the rest of the OS is functioning smoothly. Thank you.
heynnema avatar
ru flag
@MagmaCodes When you say *"I copied all the files that I could into the new folder. Many files were read only so could not copy those."*... sounds like you didn't follow my instructions exactly... and that is critical. It sounds like even though removing KDE may have helped, you still have a problem. Redo my procedure, but follow it EXACTLY. See if `terminal` opens faster than 8 seconds the first time.
MagmaCodes avatar
sa flag
To being with, I `chmod` the content of OLD cache and copied all I could without replacing the existing items. Honestly I can't say whether it is causing an issue. Apart from the terminal taking a few more seconds than it should the first time, there isn't anything else that I can make out. So this might not be the issue.
heynnema avatar
ru flag
@MagmaCodes Remember that i said that there are three folders that can cause problems. You've only done one. The .local and .config folders would be next... but you have to follow my instructions exactly.
MagmaCodes avatar
sa flag
Yeah, will do exactly as you say. But what do I need to do with the `.config` and `.local` folders? The same steps as laid down in `.cache` ?
heynnema avatar
ru flag
@MagmaCodes Yes. Do the .local folder first. It'll cause the least disruption. When you do the .config folder, a lot of settings may change, so be prepared. You're sure you got everything out of the way with the .cache folder?
MagmaCodes avatar
sa flag
Yeah, I chmodded the entire folder and copied everything to the new ones. Some were asking to replace and as you had instructed, I did not replace those but kept the newly generated ones. I saw that various remnants of the Plasma DE were still left. Didn't do anything with those. The OS feels smooth nonetheless but I think it was smoother by a little bit with the new cache folder. But again. it was very small difference. Also, sorry for the late replies.
heynnema avatar
ru flag
@MagmaCodes There should be no reason to chmod anything. Do the .config folder next. Report back.
MagmaCodes avatar
sa flag
did the `.local` folder. It was 20Gb but didn't improve. Doing the `.config` folder now.
MagmaCodes avatar
sa flag
I think we found our culprit. Now the performance is much better. The terminal still takes time to load. So I think `.cache` and `.config` folders have some things to slow up the system. Can you please instruct me on what to do next.
heynnema avatar
ru flag
@MagmaCodes Good news! You can try disabling the dash-to-dock and hidetopbar gnome-shell extensions, and see if that helps.
MagmaCodes avatar
sa flag
THANK YOU FOR YOUR TIME AND HELP.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.