DockerサービスによりCPU使用率が100%発生する

DockerサービスによりCPU使用率が100%発生する

最近、私のCPUは非常に奇妙な動作を示しています。約20のドッカーサービスを含む一般的な設定を実行すると、著しく速度が遅くなることがわかりました。私のラップトップが特別な理由なくロードに追いつくことができなくなり、約2ヶ月が経過しても仕事にほとんど使用できないように感じます。

私は問題を解決し、解決策を研究するのに多くの時間を費やしました。私のカーネルはです4.19.60-1-MANJARO。記載されているほとんどすべてを試しました。CPU周波数スケーリングArchWikiの記事。

$ grep "model name" /proc/cpuinfo
model name      : Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz

ガバナーをperformance8コアすべてに変更し、cpupower許容される最低周波数を2.5GHzに設定してみました。

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 
performance
performance
performance
performance
performance
performance
performance
performance

アイドル状態の場合、システムは期待どおりに見えます。

  $ sudo i7z
  Real Current Frequency 3367.10 MHz [99.94 x 33.69] (Max of below)
  Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp      VCore
    Core 1 [0]:       3367.10 (33.69x)      3.04    11.7       1    14.5    67.1    48      1.1041
    Core 2 [1]:       3005.90 (30.08x)      2.49    7.09       1    4.53    83.2    47      1.1041
    Core 3 [2]:       3109.65 (31.11x)         1    3.15       1       1    93.3    49      1.1042
    Core 4 [3]:       3280.22 (32.82x)      4.97    6.89       1    4.18    78.9    48      1.1040

ただし、簡単な作業を行いますsystemctl start dockerでもDockerコンテナを実行すると、すぐにCPUが約700〜900MHzに調整され、すべてのコアでCPU使用率が100%発生します。

$ sudo systemctl start docker && i7z
Max Frequency without considering Turbo 1898.94 MHz (99.94 x [19])
Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  39x/38x/37x/37x
Real Current Frequency 945.70 MHz [99.94 x 9.46] (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp      VCore
        Core 1 [0]:       945.63 (9.46x)        99.9    47.5       0       0       0    52      0.6639
        Core 2 [1]:       945.65 (9.46x)        99.9    47.5       0       0       0    51      0.6642
        Core 3 [2]:       945.68 (9.46x)        99.9    47.5       0       0       0    53      0.6641
        Core 4 [3]:       945.70 (9.46x)        99.9    47.5       0       0       0    51      0.6641

サービスを停止すると、CPUはすぐに通常状態に戻ります。

追加周波数情報:

  $ cpupower frequency-info
  analyzing CPU 0:
  driver: intel_pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 3.90 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 2.50 GHz and 3.90 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.23 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes

ターボモードが有効になっています。

$ cat /sys/devices/system/cpu/intel_pstate/no_turbo 
0

/sys/module/processor/parameters/ignore_ppc1を。

Ubuntuでこれらのテストを実行してみましたが、まったく同じ結果が得られたので、問題はOSに限定されていないと思います。数ヶ月前のDockerバージョンを使用していますが、アップグレードしても18.09.8-ce, build 0dd43dd87f役に立ちませんでした。数十のタブが開いていて、複数のChromeインスタンスを持つ重いIDEを含む、CPU使用率を制限することなく、他のすべての一般的なタスクを実行できます。

現時点ではアイデアが不足しており、どんな提案でも聞きたいです!ありがとうございます。

ベストアンサー1

おすすめ記事