Seriously high CPU usage and sluggish operation on new install

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Raife

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife »

Thanks,

I am currently using Kernel 4.10, but I see versions 4.11 and 4.13 as options in the updater. It's just that my current (and latest) install is nearly perfect (after a warm-boot). So, frankly, I am somewhat reticent to experiment with kernels (and risk breaking my installation) only to have the same problem afterwards, or lose what I have now, and have to start over, again.

There's got to be a simple reason for this problem... if only I can find out what is causing this.

By the way, how do I do a reboot during the grub-boot-process? Should I use a shell-script..? Clearly, if I use a script, I'll have to be careful with my logic. I don't want to get stuck in an endless re-boot loop.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Seriously high CPU usage and sluggish operation on new install

Post by Termy »

Yeah, you don't want that.

Installing, loading, and switching kernels is very easy and well handled in at least Debian/Ubuntu based systems, in my experience. It's unlikely to cause major issues, and I can confidently say that I could tinker with kernels all day long and lose nothing other than time. When you boot up the machine, you get the GRUB, which you can use to pick which kernel to start the system with.

It's entirely possible to install a kernel and have it refuse to boot; I've had this happen a couple of times, but it was always an easy fix; I just needed to load up a working kernel version at startup, then remove the one which didn't work. A couple of times, it only didn't work because I forgot the headers or something.

Still, that all said, there is a very small chance that the deb package(s) are screwed up, and somehow something goes awry during the installation of the kernel and/or its associated packages. I'd understand if you didn't want to take even this very unlikely risk. I'd say it's unlikely, at least. xD

Anywho, I'm afraid I don't know the answer to your question regarding rebooting from GRUB, but, I can tell you what I would try:

See, I know you can reboot from the bash-like GRUB recovery mode, you just type in reboot. Since the grub startup files seem to use the commands you can enter on the GRUB recovery mode, I imagine just adding "reboot" would work. BUT, it would always reboot and thus you'd be in another pickle (a fixable one, with a LiveCD).

To get around this, my approach would probably be to add the following to /boot/grub/grub.cfg, where the file is on my installation. I'm not suggesting you do this right now, just that it's what I would do. By the way, during updates that file can be changed and updated, so editing that particular file is not a permanent solution. After the line which sets the root variable:

Code: Select all

status_file="/etc/grub_reboot_status"
if ! [ -f "$status_file" ]; then
	rm "$status_file"
	reboot
else
	> "$status_file"
fi
Unfortunately, I have a feeling you only get read access, which means > and rm wouldn't work. Furthermore, I don't even know if even the bash-like recovery mode allows for redirection and even the rm command; it's only a very basic, shell. Still, that would be my attempt. I'd probably first try it from GRUB, before editing the file, to save myself hassle if it goes wrong. I'd press "e" while highlighting the menu item of choice in GRUB.

If that were a no-go, I'd resort to making the same thing happen after Linux has been loaded. I'd use the above code in an sh script, then see if I could run that script from GRUB.

However, it probably wouldn't work, in which case I'd have it run when I logged in, which would sadly take a lot, lot longer, but should work, provided the machine runs well enough to get to that point. xD I'd probably want to actually have the code in the script run in $HOME/.profile, so it's caught before a bunch of other things get loaded; should speed things up too. You can make things run even before you've logged in, but I can't remember exactly how I did it. -_-

Sorry for the long post. Hope it helps at all.
I'm also Terminalforlife on GitHub.
Raife

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife »

I have upgraded my kernel to "4.11.0-14-generic", but I am experiencing no difference in the cold-boot/warm-boot CPU-usage problem. I am beginning to wonder if I could run a long delay during boot to give the machine time to fully initialize the hardware. Or, perhaps I could, somehow, re-initialize everything during kernel-load.

This is maddening. Mint w/Cinnamon in insanely, unbelievably, staggeringly, awesome... after, a warm-boot.

What are the differences, from the kernel perspective, between a warm-boot and a cold-boot? Why won't my laptop just boot and run? And, why can't I actually find out what the CPU is actually being used for, after a cold-boot ("System Monitor" just doesn't show anything useful. Nor, have any of the terminal commands actually shown what is using the resources)?

Something... some process... is clearly running in circles... but only after a cold-boot. This is not just related to my hardware or BIOS, since others (with entirely different hardware) are having the same issue. And, it doesn't actually appear to be related to the DE ("Cinnamon"). Based-upon speeds of actions during boot, it seems to be occurring before the GUI is even loading (the real slow-down seems to occur around the graphical log-in screen). Also, sometimes after a cold-boot, the OS runs great. So, it isn't strictly a cold-boot situation (again, however, I have never observed this high CPU-usage after a warm-boot).

Most of my Mint installs have run awesomely (or, had obvious reasons for any issues that cropped-up). And, most of the other people that install Mint have the same reactions. It seems, however, to be a few people's hardware that is randomly triggering some kind of (seemingly untraceable) bug, at a low level, since re-installing doesn't seem to change anything.

The help I have received here has been simply amazing. Thanks to everybody. And, I haven't given up hope. And, I really do still believe that there is a really simple answer that will make this inscrutable problem simply disappear. I just need a SUPER-GURU, or just the right Google-search, to explain what is happening, or a way to side-step the problem.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Seriously high CPU usage and sluggish operation on new install

Post by Termy »

:(

You mention the login screen. If you want, you could install and use a super light display manager called xdm (should be available for you). I use it sometimes myself. If your experience is super awesome after using that, it could be that your DM is at fault after all.

Install xdm: sudo apt-get install xdm
Back up system file: sudo cp /etc/X11/default-display-manager{,.bak}
Edit system file: echo "/usr/bin/xdm" | sudo tee /etc/X11/default-display-manager

Then reboot. You should then see a super-fugly log-in screen. Log in and basically just use the machine to see what happens.

To undo those changes:

Remove xdm: sudo apt-get remove xdm
Restore backup: sudo mv /etc/X11/default-display-manager{.bak,}

If this works, at least it'll let you use the machine properly. Don't remove the other one though, at this point, just in-case. (paranoid xD) You can always go back to lightdm if you're using mdm at the moment, or try another one like sddm if you're using lightdm at the moment. Typically, sddm is found in KDE, although I'm not sure how that goes with Mint; very pretty, but brings in a lot of stuff, even if you specify not to install with the recommended packages, IIRC.
I'm also Terminalforlife on GitHub.
Raife

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife »

I installed XDM (and then restored LightDM) twice... just to be sure I did it right, and the laptop continued to function Identically as before (CPU usage at around 20% after a reboot, around 95% after a cold-boot). I do think this was definitely worth trying. Of the four parts of the OS (kernel, Gnu/Linux OS, Desktop Manager, GUI/Desktop-Environment) I think I can now rule-out the DM from Mint-18.x -w/Cinnamon.

Also, the behavior after my trying the Cinnamon-DE resets, seemed to have no effect on the problem. So, now I am hoping to find a kernel-switch that will let me try resetting my laptop's hardware-components during boot. I also am considering installing "MATE" alongside "Cinnamon", just to see if it [Mate] has the same problem. If it does exhibit the same behavior, then that would tend to point to the core-OS as the source of this issue.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Seriously high CPU usage and sluggish operation on new install

Post by Termy »

That's quite a lot of things which seem to be ruled out, now. Perhaps it's just something with your hardware which just isn't supported in Linux, or for some reason in Mint or Debian or Ubuntu, whichever. :(

Did you ever try an older kernel? I'd try 4.4, then try 4.8. Sometimes using an older kernel is the only way to just get your hardware to work. I know someone who needs to use an older kernel for their wireless to work with their laptop, for example. You'd probably lose a lot of security or other benefits though. Hope the thing with Mate works out.
I'm also Terminalforlife on GitHub.
Raife

Re: Seriously high CPU usage and sluggish operation on new install

Post by Raife »

I recently bought an HP laptop and installed Mint 18.3 to see how well it would run the OS after all of my troubles with the Toshiba laptop. Long story, short... it runs great. It is configured, and loaded with all of my software and, at this point, I am thrilled. Not that there weren't a few bumps. For example; for a while I started experiencing, random, complete system crashes/freezes during media playback (I literally had to crowbar the laptop's power to restart the system after hangs). I experienced this for about a month, but after a kernel update, and a "software center" "FFMPEG" update the problem went away completely. So, this newer laptop is now my main laptop. I'm not sure which... or, if both updates, resolved the issue.

Now, as to my older Toshiba laptop with the crushingly-high CPU usage after a cold-boot. I decided to install a new hard-drive, and install Mint-19, to see if there was any difference.

In order to install the OS, I had to run the installer without giving it WiFi access (this is apparently a known bug that can prevent successful installation of Mint-19... which it did prevent on the Toshiba laptop). After I installed Mint-19, I had to set the kernel-level chipset-hardware resets, to insure that Mint (an UBUNTU derivative) wouldn't randomly fail to properly initialize the keyboard and touchpad (also, a known UBUNTU issue with this particular Toshiba laptop).

After installation, Mint-19 ran great... cold-boot, or warm-boot... until I used the WiFi. Then I had the exact same problem... namely, more than 90% CPU usage with nothing running after a cold-boot, but very low CPU usage after a warm boot. So, I turned the WiFi off and Mint-19 ran great again... warm, or cold, boot. I turned the WiFi back on and the exact same high CPU-usage problem occurred. So, clearly, the problem resides with this laptop, Mint 18+, and WiFi.

Any ideas? I know this is an obsolete (at this point), and now unsupported, laptop, but I would still like to use this particular laptop (it runs Mint awesomely... after a warm boot, and it has a great display and software setup). However, I need both WiFi enabled, and for the laptop to just run without needing a warm-boot, every time I use it. Also, it should be noted, that (during researching this problem) I have run across this exact "high CPU-Usage" phenomena being reported by others, on several widely different laptop models, from different manufacturers. So, it isn't just my system, model, or configuration.

Sorry, for this issue running for so long, but I do appreciate all the help and suggestions that I have received so far. I have learned so much from my experience, and travails, with Mint.
Raife

Re: Seriously high CPU usage and sluggish operation on new install (SOLVED)

Post by Raife »

After determining that the "WiFi" was related to the "High CPU-usage" problem, I thought that it might just be the particular WiFi chip-set used in my Toshiba laptop. So, I turned-off the on-board WiFi and used a WiFi-dongle. However, the problem was identical (I.E. after a cold boot, very high CPU-usage when the WiFi was on, and low CPU-usage, and great performance, with the WiFi turned off). However, while I was experimenting (and leaving the "System Monitor" up while I was turning the WiFi on and off), I also incidentally discovered that simply using the network manager to turn the WiFi off, and then turning it back on, actually eliminated the high CPU-usage ...just like a performing a warm-boot, accomplished.

So, I created two "start up" applications.

MENU=>Preferences=>Startup Applications

Immediately after boot, one start-up-application turns the WiFi off (with the command: "nmcli radio WiFi off", with no delay after boot). And, one start-up-application turns the WiFi back on (with the command: "nmcli radio WiFi on", with a four second delay after boot). I also increased the "Update Manager" start-up delay to forty seconds (so there wouldn't be any problems with the WiFi not being available for the application).

Now the laptop cold-boots, turns off the WiFi, and then turns it back on, without needing any interaction by me. The result is that, after a boot (warm or cold) the CPU-usage is normal and I have WiFi. The only downside is that the boot process takes about, ten or so, seconds longer. Next, I may try to shut off the WiFi during shutdown, so that the laptop boots faster and all that is needed is to restart the WiFi after boot. In the meantime, I am currently reloading and configuring my laptop and Programming tools. I think, barring a better solution, if one ever shows up, that my Toshiba laptop problem is adequately resolved. :wink:
Locked

Return to “Beginner Questions”