全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
查看: 7710|回复: 39
打印 上一主题 下一主题

[疑问] 3O设置CPU为性能模式(C2338设置主频2100MHz)

  [复制链接]
跳转到指定楼层
1#
发表于 2019-11-14 22:04:49 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
以下是Centos7 的代码,其他系统自行搜索测试

  1. # yum install -y cpupowerutils;
  2. # cpupower frequency-info
  3. # cat /proc/cpuinfo

  4. cpupower frequency-set -g performance
复制代码


效果
推荐
发表于 2019-11-15 08:29:18 | 只看该作者
Debian
  1. apt install cpufrequtils
复制代码
  1. 编辑 /etc/default/cpufrequtils 如不存在则创建,
复制代码
  1. 添加 GOVERNOR="performance"
复制代码
  1. systemctl restart cpufrequtils
复制代码



之前:
  1. cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
  2. Report errors and bugs to [email protected], please.
  3. analyzing CPU 0:
  4.   driver: acpi-cpufreq
  5.   CPUs which run at the same hardware frequency: 0
  6.   CPUs which need to have their frequency coordinated by software: 0
  7.   maximum transition latency: 10.0 us.
  8.   hardware limits: 1.40 GHz - 2.10 GHz
  9.   available frequency steps: 2.10 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz
  10.   available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  11.   current policy: frequency should be within 1.40 GHz and 2.10 GHz.
  12.                   The governor "ondemand" may decide which speed to use
  13.                   within this range.
  14.   current CPU frequency is 1.40 GHz (asserted by call to hardware).
  15.   cpufreq stats: 2.10 GHz:100.00%, 1.80 GHz:0.00%, 1.60 GHz:0.00%, 1.40 GHz:0.00%  (65)
复制代码


之后
  1. analyzing CPU 0:
  2.   driver: acpi-cpufreq
  3.   CPUs which run at the same hardware frequency: 0
  4.   CPUs which need to have their frequency coordinated by software: 0
  5.   maximum transition latency: 10.0 us.
  6.   hardware limits: 1.40 GHz - 2.10 GHz
  7.   available frequency steps: 2.10 GHz, 1.80 GHz, 1.60 GHz, 1.40 GHz
  8.   available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  9.   current policy: frequency should be within 1.40 GHz and 2.10 GHz.
  10.                   The governor "performance" may decide which speed to use
  11.                   within this range.
  12.   current CPU frequency is 2.10 GHz (asserted by call to hardware).
  13.   cpufreq stats: 2.10 GHz:99.99%, 1.80 GHz:0.00%, 1.60 GHz:0.00%, 1.40 GHz:0.01%  (461)
复制代码

点评

Debian10测试成功,显示和层主一样,2.1 Ghz,原版BBR。  发表于 2019-11-17 22:56
cpufreq-info可以查看层主的之前之后,谢谢层主  发表于 2019-11-17 22:53
推荐
发表于 2019-11-15 08:15:10 | 只看该作者
本帖最后由 register 于 2019-11-15 08:16 编辑

楼上一些人不了解呀

performance         运行于最大频率
powersave         运行于最小频率
userspace         运行于用户指定的频率
ondemand         按需快速动态调整CPU频率, 一有cpu计算量的任务,就会立即达到最大频率运行,空闲时间增加就降低频率
conservative         按需快速动态调整CPU频率, 比 ondemand 的调整更保守
schedutil         基于调度程序调整 CPU 频率

机子默认一般运行于ondemand模式,会有中断开销,睿频也是有开销的,特别是对于低端cpu。

调整到performance模式,就是一直以最大频率运行。

其实无需安装软件包,直接创建一个udev规则
/etc/udev/rules.d/50-scaling-governor.rules

SUBSYSTEM=="module", ACTION=="add", KERNEL=="acpi_cpufreq", RUN+=" /bin/sh -c ' \
        echo performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor ' "

推荐
发表于 2019-11-14 22:05:18 | 只看该作者
没什么意义吧 自动睿频

点评

以前我在24核机器试过,有用,这个没测试,不知道效果明显不明显.  发表于 2019-11-14 22:09
36#
发表于 2019-11-19 12:34:17 | 只看该作者
no or unknown cpufreq driver is active on this CPU
  CPUs which run at the same hardware frequency: Not Available
  CPUs which need to have their frequency coordinated by software: Not Available
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: Not Available
  available cpufreq governors: Not Available
  Unable to determine current policy
  current CPU frequency: Unable to call hardware
  current CPU frequency:  Unable to call to kernel
  boost state support:
    Supported: yes
    Active: yes
35#
发表于 2019-11-18 13:59:36 | 只看该作者
不错不错,已经成功

34#
发表于 2019-11-18 13:46:13 | 只看该作者
效果还是很明显的。谢谢啦
32#
发表于 2019-11-17 23:25:56 来自手机 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
30#
发表于 2019-11-17 22:39:38 来自手机 | 只看该作者
这种模式调整只适用于debian,上次在Let论坛看到的,部分系统,并不生效
28#
发表于 2019-11-17 22:18:49 | 只看该作者
通过对比试验确定,centos7如果使用一键脚本更换内核并更新后,它的最高频率只能是1750,可能是内核兼容性问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-1-14 16:16 , Processed in 0.064166 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表