CentOS保守的な知事、良い間違い

CentOS保守的な知事、良い間違い

CentOS 6 CPUガバナーをオンデマンド(デフォルト)からメンテナンスに変更し、cpufreqサービスを再起動した後、次の結果が得られました。

/etc/rc5.d/S13cpuspeed: 行 88: /sys/devices/system/cpu/cpufreq/conservative/ignore_nice_load: ファイルまたはディレクトリが存在しません。

ではどうすればいいですか?このファイルを作成する必要がありますか?それでは、そこに何を入れるべきですか?

ベストアンサー1

3.x カーネルの場合

最新のカーネルでは、CPUFreqへのインタフェースが変更されました。これにはCentOS 6が含まれます。次のタイトルのRed Hat Enterprise Linux(RHEL)ドキュメントから、インターフェイス全体を読むことができます。第3章コアインフラストラクチャとメカニズム

具体的にCPU周波数設定。設定に必要な手順は次のとおりです。

CPU周波数ドライバ

$ ls -1 /lib/modules/`uname -r`/kernel/arch/x86/kernel/cpu/cpufreq/
acpi-cpufreq.ko
mperf.ko
p4-clockmod.ko
pcc-cpufreq.ko
powernow-k8.ko
speedstep-lib.ko

適切なドライバをロードしてください。

$ modprobe acpi-cpufreq

CPUPowerツールのインストール

$ yum install cpupowerutils

ガバナーを見る

$ cpupower frequency-info --governors
analyzing CPU 0:
ondemand userspace performance

したがって、現在、次の3つのガバナーのみがロードされています。オンデマンドユーザースペースパフォーマンス

ロードミスガバナー

以下のように、利用可能なすべてのガバナーのリストを入手できます。

$ ls -1 /lib/modules/`uname -r`/kernel/drivers/cpufreq/
cpufreq_conservative.ko
cpufreq_ondemand.ko
cpufreq_powersave.ko
cpufreq_stats.ko
freq_table.ko

$ modprobe cpufreq_powersave

これまでに確認されたモジュール:

$ lsmod |grep cpuf
cpufreq_powersave       1196  0 
cpufreq_ondemand       10544  8 
acpi_cpufreq            7763  0 
freq_table              4936  2 cpufreq_ondemand,acpi_cpufreq
mperf                   1557  1 acpi_cpufreq

どのガバナーがロードされたかを確認する

$ cpupower frequency-info --governors
analyzing CPU 0:
powersave ondemand userspace performance

現在のポリシーを見る

$ cpupower frequency-info
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 1.60 GHz - 3.20 GHz
  available frequency steps: 3.20 GHz, 3.20 GHz, 3.07 GHz, 2.93 GHz, 2.80 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz
  available cpufreq governors: powersave, ondemand, userspace, performance
  current policy: frequency should be within 1.60 GHz and 3.20 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 1.60 GHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes
    2500 MHz max turbo 4 active cores
    2500 MHz max turbo 3 active cores
    2500 MHz max turbo 2 active cores
    2600 MHz max turbo 1 active cores

上記の出力から、現在の戦略が次のようになることがわかります。オンデマンド。ポリシーと速度を調整するには、次のコマンドを使用します。

$ cpupower frequency-set --governor performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7

新しい知事の確認

$ cpupower frequency-info
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 1.60 GHz - 3.20 GHz
  available frequency steps: 3.20 GHz, 3.20 GHz, 3.07 GHz, 2.93 GHz, 2.80 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz
  available cpufreq governors: powersave, ondemand, userspace, performance
  current policy: frequency should be within 1.60 GHz and 3.20 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 3.20 GHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes
    2500 MHz max turbo 4 active cores
    2500 MHz max turbo 3 active cores
    2500 MHz max turbo 2 active cores
    2600 MHz max turbo 1 active cores

ポリシー内で最小/最大CPU頻度を調整することもできますcpupower frequency-set --min <freq> --max <freq>。これを見てできることの詳細を学ぶページcpupower frequency-set

cpupowerutilsなしで上記の操作を実行してください。

最後に、cpupowerutilsパッケージがインストールされていない場合は、以前の2.6カーネルで行ったように対話できます。最も重要なのは、値をsysfsファイルシステムに反映することです。

例えば

$ echo 360000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

2.6 カーネルの場合

様々な内容を読むことができます。このウェブサイトのcpufreq機能

から抜粋LinuxでCPU周波数を調整するには、cpufreqを使用してください。

ignore_nice_load - このパラメータの値は「0」または「1」です。 「0」(デフォルト)に設定すると、すべてのプロセスが「CPU使用率」の値として計算されます。 「1」に設定すると、「nice」値で実行されるプロセスは、全体使用量計算では計算されません(したがって無視されます)。これは、ラップトップでCPU集約的な計算を実行して完了するのにかかる時間が重要でない場合に便利です。これは、「最適化」しているかどうかに関する意思決定プロセスに関与するのを防ぐことができるからです。 CPU周波数を上げるにはこの機能をオンにするには、次の手順を実行します。

sudo sh -c "echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load"

これがデフォルトでなければならないので、このファイルに0を入れます。良い長期実行プロセスがある場合(非常に疑わしい)、この値を1に設定できます。

おすすめ記事