LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-10-2023, 09:02 AM   #1
friv
LQ Newbie
 
Registered: Feb 2023
Posts: 3

Rep: Reputation: 0
Kswapd0 process is using an incredibly high amount of CPU usage


Because of kswapd0 command which appear in my Putty afte command "top" and eating CPU and RAM, my websites are going down for couple of minutes.

Did somebody have an idea how to stop that process?
Is there some script or command which i can execute in Putty to that finally can stop?

I have read a lot of solutions on internet about kswapd0 how to solve that step by step, but without success.
 
Old 02-10-2023, 12:27 PM   #2
lvm_
Member
 
Registered: Jul 2020
Posts: 961

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
This process manages swapping, and if it is active it means that you don't have enough memory. You have either buy more RAM or tune your processes to use less of it. Decreasing vm.swappiness (temporary - using sysctl, permanently - in /etc/sysctl.conf) may have some effect too, but it is not magic.
 
1 members found this post helpful.
Old 02-10-2023, 01:28 PM   #3
friv
LQ Newbie
 
Registered: Feb 2023
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lvm_ View Post
This process manages swapping, and if it is active it means that you don't have enough memory. You have either buy more RAM or tune your processes to use less of it. Decreasing vm.swappiness (temporary - using sysctl, permanently - in /etc/sysctl.conf) may have some effect too, but it is not magic.
Yes,i understand that i not have memory because of that process .But that is not due big traffic,that is i think malware which is injected in to my server for example crypto miners etc. So,the problem is how to find that malware and remove he.
 
Old 02-10-2023, 02:53 PM   #4
friv
LQ Newbie
 
Registered: Feb 2023
Posts: 3

Original Poster
Rep: Reputation: 0
Yes,i know that i not have memory but that is not the case because of big traffic. I think this is a malware which is injected maybe for crypto mining or something else.
So,now i need to find solution how to remove that malware.
 
Old 02-10-2023, 04:28 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
If it is, and is any good it will be difficult to find. Have a read of this as an example of how sophisticated they can be.
 
Old 02-11-2023, 04:43 AM   #6
lvm_
Member
 
Registered: Jul 2020
Posts: 961

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
Unexpected high CPU usage, yes, could be a sign of nefarious activity, high network traffic - also yes, high disk activity - maybe, but high memory usage - unlikely. It is, of course, easy and satisfying to blame all problems on unknown malware, but, even if it is the cause, first you'll have to make sure that all legitimate processes are properly configured and operate within configured parameters, and then you'll either spot a configuration issue or something unknown.
 
Old 02-11-2023, 07:04 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336Reputation: 7336
kswapd itself is not a malware. If your host is infected you need to run a scanner to check it.
From the other hand probably kswapd is busy because your host is low on memory. Stopping this process may kill your system completely.
 
Old 01-09-2024, 05:16 PM   #8
lesebas
LQ Newbie
 
Registered: Jan 2024
Posts: 3

Rep: Reputation: 0
This is a known bug unsolved for several years now.

https://bugzilla.kernel.org/show_bug.cgi?id=110501
 
Old 01-10-2024, 03:29 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
The "K" processes such as this one are a fundamental part of the kernel which run like processes. You cannot kill them, and you would not want to try.
 
Old 01-11-2024, 02:13 AM   #10
lesebas
LQ Newbie
 
Registered: Jan 2024
Posts: 3

Rep: Reputation: 0
Hello,

Right you can not kill the process. However it seems that the mgkru function introduced in kernel 6.1 can solve the issue (I received an answer in this way oin kernel bugzilla thread : https://bugzilla.kernel.org/show_bug.cgi?id=110501#c39).

This should be activated : https://dev.to/archerallstars/enable...-oom-today-ji6.

I will try and see if it can helps.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network problems under high load which causes high CPU usage in processes using network arivo Linux - Networking 2 08-09-2021 03:21 AM
[SOLVED] High CPU load, top not showing any high CPU process angel115 Linux - Server 8 10-12-2015 12:58 AM
[SOLVED] High CPU load, but low CPU usage (high idle CPU) baffy Linux - Newbie 5 03-13-2013 09:24 AM
high memory and cpu usage when copying large amounts, KSWAPD0 ouigkmy Linux - General 5 08-02-2011 06:32 AM
[SOLVED] kswapd0 - smbd - Very high use of hard-drive thus very bad system response qlands Linux - Software 1 10-06-2010 08:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration