一、工具准备
- 安装 cpulimit(支持 Debian/Ubuntu 系)
bash
sudo apt update
sudo apt install cpulimit
二、快速操作指南
- 查找目标进程 PID
bash
# 示例:查找Python进程
ps aux | grep python
- 限制 CPU 使用率(示例:限制到 50%)
bash
sudo cpulimit -p [PID] -l 50
- 验证效果
bash
# 方法1:实时监控
htop
# 方法2:命令行验证
ps -eo pid,%mem,%cpu,command | grep [PID
«
《DNS服务器防骗指南:别让你的电话总机变成诈骗中转站》
»
CentOS7 根分区满了?三步快速清理指南