Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

kswapd0 / kcompactd0 using a ton of CPU on a system without swap

Featured Replies

Hello

Not sure if the cause is that I used to have the swap plugin, but now I have this issue. kcompactd0 kicks in and uses a lot of CPU very often killing VM performance despite CPU pinning.

 

I also noticed that I have bery little free ram?

 

MiB Mem :  63665.3 total,    862.2 free,  10738.7 used,  52064.4 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.  35281.2 avail Mem

 

Is this normal behavior?

s4-unraid2-diagnostics-20240127-2055.zip

  • Community Expert
9 hours ago, fr500 said:

I also noticed that I have bery little free ram?

This is the important part:

9 hours ago, fr500 said:

35281.2 avail Mem

 

  • Author

alright, so is kswapd even available on unraid by default? or did I install something and screw myself up?

image.thumb.png.032984ad3a1f209780eb7afa496b2182.png

Edited by fr500

  • Community Expert

Did you reboot after uninstalling the plugin?

  • Author

Yeah..

I'm thinking the plugin may alter some sysctls, because I was able to stop this behavior by setting these flags:

 

sysctl -w vm.swappiness=0
sysctl -w vm.compaction_proactiveness=0
sysctl -w vm.extfrag_threshold=1000

 

Swappiness only didn't stop it, but after the other two it did

  • Author
2 minutes ago, fr500 said:

Yeah..

I'm thinking the plugin may alter some sysctls, because I was able to stop this behavior by setting these flags:

 

sysctl -w vm.swappiness=0
sysctl -w vm.compaction_proactiveness=0
sysctl -w vm.extfrag_threshold=1000

 

Swappiness only didn't stop it, but after the other two it did

 

So I guess I gotta check what the default values were for these

  • Community Expert

After a reboot everything should go back to defaults, default for this one for example is 60

5 minutes ago, fr500 said:

sysctl -w vm.swappiness=0

 

  • Author

Yeah that's the case for me too...

So weird then, I don't know why kcompactd0 is pegging one core every few minutes when I have so much ram free

  • Author

This is so annoying, the only way I have managed to avoid kcompactd0 from kicking in and messing things up is

 

at 01:00 a, I do

 

echo never > /sys/kernel/mm/transparent_hugepage/defrag
sysctl -w vm.compaction_proactiveness=0
sysctl -w vm.extfrag_threshold=1000

 

Then at 00:00 I do

 

sysctl -w vm.compaction_proactiveness=20
sysctl -w vm.extfrag_threshold=500
echo always > /sys/kernel/mm/transparent_hugepage/defrag
sysctl -w vm.compact_memory=1

 

Now instead of kcompactd0 I get khugepaged going overboard for a while every 30 minutes or so but it's definitely not as annoying as kcompactd0 hoarding one CPU for 10 minutes

 

Guess I'll need to start over with my seup, I probably installed something the screwed something up

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.