惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threatpost
GbyAI
GbyAI
V
Visual Studio Blog
H
Help Net Security
Vercel News
Vercel News
P
Palo Alto Networks Blog
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Latest news
Latest news
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
The Register - Security
The Register - Security
博客园_首页
WordPress大学
WordPress大学
G
GRAHAM CLULEY
T
Tor Project blog
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
AI
AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
O
OpenAI News
博客园 - 聂微东
月光博客
月光博客
S
Security Affairs
Webroot Blog
Webroot Blog
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
N
News and Events Feed by Topic
Blog — PlanetScale
Blog — PlanetScale
S
Securelist
V
Vulnerabilities – Threatpost
aimingoo的专栏
aimingoo的专栏
阮一峰的网络日志
阮一峰的网络日志
Stack Overflow Blog
Stack Overflow Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Cisco Talos Blog
Cisco Talos Blog
The Cloudflare Blog
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss

老孙博客

搬家 & 测试 又一款Typecho主题 - Jaguar 又一款Typecho 主题Timellow 又一款Typecho主题 Clarity Typecho 缝合怪插件Enhancement 随手记 20260128 装机计划 and 环境部署 一个基于AI的Typecho辅助生成插件 AIHelper 修复Typecho UploadPlugin插件在1.3.0中的上传问题 规则 "套娃" Typecho RSS 全文输出美化插件 Puock - 又一款Typecho主题 又年长一岁 Typecho常用插件集合 2025年06月第2周记 优化Typecho的思路 Typecho文章置顶(非插件) Typecho根据slug添加icon Mastodon新通知推送NoneBot
解决部分云服务器内存爆满但SWAP占用为0的问题
老张博客 · 2025-08-09 · via 老孙博客

问题

在内存爆满几乎100%的情况下,开启了swap分区却占用一直为0,这种情况发生在阿里云 和 华为云 比较多.

排查

查看系统的 Swap 使用倾向(swappiness),执行

cat /proc/sys/vm/swappiness

最小为0最大为100 数字越小代表使用倾向越低.

我的华为云服务器查询到的数值竟然为0. 这意味着云服务商根本就不打算让人使用swap.

解决

编辑配置

sudo nano /etc/sysctl.conf

找到

vm.swappiness=

把后面的数字改为90
如果没有找到,也没关系,直接在最后添加

vm.swappiness=90

然后执行

sudo sysctl -p

可以生效了