我试着用Ubuntu操作系统来制作服务器,我不希望CPU总是以高频率运行,只是为了节省电费。
我希望它在没有负载的情况下以低频工作,如果服务器上有负载,则工作频率较高。
发布于 2022-09-03 05:59:36
有一个包"cpulimit“可以用来限制消耗过多资源的特定进程的cpu百分比。
在安装之后
sudo apt update && sudo apt install cpulimit您可以使用它来限制1-进程(按ID)或2-进程(根据可执行文件的名称)或3-的资源消耗分别使用-p、-e和-P的路径。
这些例子来自手册:
cpulimit -e foo -l 50
limits the CPU usage of the process by acting on the executable
program file (note: the argument "--bar" is omitted)
cpulimit -p 1234 -l 50
limits the CPU usage of the process by acting on its PID, as
shown by ps(1)
cpulimit -P /usr/bin/foo -l 50
same as -e but uses the absolute path namehttps://askubuntu.com/questions/1427278
复制相似问题