kswapd0占用cpu很高解决

原文

写在前面:
在按这种方式解决之前,先确定你的kswapd0是系统自带的正常进程,还是kswapd0病毒,kswapd0病毒怎么排查网上文章很多

病毒可参考:https://blog.csdn.net/jzz601264258/article/details/105850816

How To resolve High CPU occupation from kswapd0

Why?

kswapd0, manages virtual memory and may be having issues due to moving processes to SWAP too frequently, causing cpu spikes and decreased system performance.

High CPU Usage of kswapd0 indicates insufficient memory and memory swapping is in progress.

Checking

Swappiness

cat /proc/sys/vm/swappiness
This control is used to define how aggressive the kernel will swap
memory pages.  Higher values will increase aggressiveness, lower values
decrease the amount of swap.  A value of 0 instructs the kernel not to
initiate swap until the amount of free and file-backed pages is less
than the high water mark in a zone.

The default value is 60.

Set to 0 can prevent swap activity in unnecessary.

vfs_cache_pressure

cat /proc/sys/vm/vfs_cache_pressure

default value is 100, when set to 0, it will never reclaim dentries and inodes due to memory pressure and this can easily lead to out-of-memory conditions. With vfs_cache_pressure=1000, it will look for ten times more freeable objects than there are.

transparent_hugepage

cat /sys/kernel/mm/transparent_hugepage/enabled

In short it should be set to always

Fixing

Prevent swappiness

echo vm.swappiness=0 | tee -a /etc/sysctl.conf

Clear Cache

echo 1 > /proc/sys/vm/drop_caches

Reference

Documentation for /proc/sys/vm/*

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值