Kali Linux high cpu usage

JAGHERMEISTER

New Member
Joined
Apr 14, 2021
Messages
5
Reaction score
0
Credits
48
Hello everyone!

I'm having this problem with kali linux that i installed on my laptop.
The problem is that sometimes (not always), after a while of usage, Kali slows down so much the whole system is barely usable.
Everything becomes laggy. Switching between tabs on the Firefox Browser has a lot of lag.
The Terminal becomes laggy, typing commands and typing in general, is getting slow.
A reboot always fixes the problem.

Like i said thankfully it doesn't always happen.
My laptop is fast enough to run Kali. I dont know why or when it starts to happen.
It seems to slow down suddenly and occasionally.

My laptop is a Toshiba Satellite L875D-10N

CPU : AMD A8-4500M Quad Core 1,9GHz ( 2,8GHz max with turbo )
RAM : 6GB DDR3

I installed the 64bit version from kali.org using a USB stick.
There were no problems installing Kali.


I think the problem must be related to the CPU.

When typing in the htop command, i've noticed some strange output.
Normally when the problem occurs, one of the four CPU/Cores seems to do all the work :

HTOP5.png


As you can see, number 3 is working at it's maximum while the other 3 aren't working as much.




Another example when the problem occurred. ( This time it was Core number 0 doing all the work ) :

HTOP.png




Did any of you guys had the same problem? Does anyone knows how to fix this?
I'm not a beginner linux user anymore but i don't consider myself an expert either.


Any help will be much appreciated!


JAGHERMEISTER
 
Last edited:


Looks like, in the first case kazam (what ever that is) and in the second case qterminal, are pushing your cpu to its limits.
 
Looks like, in the first case kazam (what ever that is) and in the second case qterminal, are pushing your cpu to its limits.
Yes, but the point is that the 4 CPU's dont work together as they should (when the problem occurs).
Kazam is a program which allows you to take screenshots or record your screen.
 
Last edited:
Moving this to Kali subforum, where it should be.

Good luck.

Note change of venue @Peer , @captain-sensible

Wizard
 
Yes, but the point is that the 4 CPU's dont work together as they should (when the problem occurs).
Kazam is a program which allows you to take screenshots or record you screen.

Most applications are not able to utilize all of your cpu cores, the most ones are only able utilize one core. That's the nature of most programms and programming languages and is completely normal.
 
Moving this to Kali subforum, where it should be.

Good luck.

Note change of venue @Peer , @captain-sensible

Wizard
Allright thank you!

Most applications are not able to utilize all of your cpu cores, the most ones are only able utilize one core. That's the nature of most programms and programming languages and is completely normal.
Thanks for your response!

Mmm.. Well, it's strange that normally, it just runs smooth, and the 4 cores are working together just fine, as seen in the following example :

HTOP4.png


Here is was running multiple 4K videos on youtube to test the performance, and it just works fine, without lag (as it should).

Oh and by the way when the problem occurs, even if i close ALL applications, the system is still slow and laggy and the only way to fix the problem is to reboot Kali.
 
Last edited:
Try installing a stress test tool on your machine and then run a stress test on all 4 cores of your CPU, usually those are written with multi-core support. If that results in fairly even results then the programs you are having problems with don't utilize the CPU cores as well as a stresser does. Also I read somewhere that Firefox creates a new process for each tab and and even some videos are run in a separate process so that probably gets divided over the CPU cores more evenly when running a video through Firefox.
 
I have had the same problem. It happens randomly, sometimes when I was using high CPU. The problem seems to involve Xorg. I'm using linux on a USB pendrive. Does that have something to do with it? please, any idea on how to solve it?

ps: I've seen that the same problem is occurring with many other people with other distros as well.
 

Attachments

  • Screenshot_2023-01-16_16_22_02.png
    Screenshot_2023-01-16_16_22_02.png
    241.4 KB · Views: 161
Last edited:
a friend of mine preinstalled it in my USB, and I've become familier to it, have many projects in it, etc...

Anyway, if you don't mind, your question can be considered rude
 
anyway, this happened again today (actually, happened 3 times today!!)
 

Attachments

  • rsz_1screenshot_2023-01-30_14_34_30.png
    rsz_1screenshot_2023-01-30_14_34_30.png
    363.4 KB · Views: 176
Anyway, if you don't mind, your question can be considered rude
Our associate is not being rude, Kali is designed for one job and one job only Pent-Testing, it is not designed for use as an everyday desktop, and doesn't guarantee to support any applications not available in the repository provides [see the full kali documentation]
your AMD A8-4500M Quad Core is fully supported by the kernel drivers and capable of running any 64 bit Linux,
have you had this problem from day one or has it recently started,?
if recent, what did you install before it started playing up? [a new application,an update etc]
Did you install timeshift or similar, if so do a restore from there,
find the offending applications that are burning the cpu.. and delete them if you added them https://unix.stackexchange.com/questions/20483/how-to-find-which-process-is-causing-high-cpu-usage
 
Aha - USB Pendrive - that’s almost certainly the cause of the slowdown.

The CPU usage is almost certainly a red herring. Sure, one thread/core is running at 100%, but the others have plenty of overhead. The processor is working properly and is NOT the cause of your slowdowns/freezes.

The actual problem is that the USB bus can only handle a certain amount of simultaneous throughput.

If you’re running a LOT of intensive processes, especially if they’re performing a lot of disk read/write operations, then some processes will eventually have to wait for other processes to finish their read/write operations before they can access the disk.

So you’ll potentially see huge slowdowns when the system is really busy. Especially if you have any kind of persistent volume on your USB stick. (E.g. a data partition for saving documents, settings and data).

Eventually, it may seem like X is crashing. It’s not, it’s just that there are so many processes waiting to read/write to/from the USB stick and there are loads of processes stalled. Eventually it will just keep building up and will go slower and slower.

You will have seen a similar kind of effect if you’ve ever tried to copy multiple, simultaneous batches of files to a USB stick.

E.g.
You drag a large number of files and it says it will take 10 minutes. Then whilst they’re copying, you drag another bunch of files to the stick, so now you have two simultaneous copy operations, now the first process says it’s going to take 20 minutes and the new process data it’s going to take 30 minutes. And the more simultaneous copy operations you add - the longer each of the already running copy operations say they’re going to take…..

This is because of the limited throughput of the USB bus and each device connected to it. The bus may be high-speed, but the overall speed of each transfer depends on the speed of the device, which is usually much lower than the bus speed, especially with pendrives.

So if you’re running Linux from USB, even if you shut down a number of intensive processes - the system will not return immediately to full speed. Not until all pending read/writes have occurred. So it may take a while for cached data to be written to the drive and for the system to catch up with all of the pending read/writes.

Are you using Kali for a security related course, or career? Or are you using it as your daily driver, for everyday use?!

I’m only asking because if you’re using Kali, is there any need to be watching multiple videos in Firefox, whilst screen casting with kazam?!

When running Linux on a USB stick, regardless of the distribution, you need to take the limited throughput of USB into account and not try to run too many read/write intensive processes at once.

The more read/writes you have going on, the slower and more sluggish the system will become. If you have too many going on, the queue keeps growing and more processes stall whilst waiting to read/write and everything gets slower and slower.

If you want to run all of the things at once, then install it to an SSD or HDD, which can deal with more throughput!
 
Aha - USB Pendrive - that’s almost certainly the cause of the slowdown.
I don't use Kali but when I need to use something that requires a flash drive with speed I bring along a M.2 NVMe SSD Enclosure with an nvme ssd in it, it's way faster than any normal usb flash drive out there and you will have more space as well.
 
Last edited:
but when I need to use something that requires a flash drive

I run my Parrot from an old SATA laptop drive using a SATA/USB adaptor, as it dose'nt have to be fast, just stable
 
I run my Parrot from an old SATA laptop drive using a SATA/USB adaptor, as it dose'nt have to be fast, just stable
I was responding from @JasKinasis's comment about Kali in a lot of cases being run of a usb flash drive and the person he was replying to was running into a speed issue.
 


Top