0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

cpuのモードを切り替えてサーバを早く動かす方法のメモ(非クラウド限定)

Posted at

cpuのモードを切り替えてサーバを早く動かす方法のメモ

まとめ

  • cpu governorの設定を変更する
  • Ubuntuの場合 cpufrequtilsを使う
  • RedHatの場合 tuned-admを使う

cpuのモードを切り替えて処理を高速化する

OS毎にcpuのモードが存在して、大体のところ、省電力 or エコモードみたいなものに設定されている
そのモードを電力無視&cpuパフォーマンス最優先モードにすると、パフォーマンスが改善する
クラウドではないオンプレやレンサバ、個人のローカルPCでのみ有効なので注意。

Ubuntuではcpuのgovernor設定をperformanceに、
RedHatでは同設定をlatency-performanceにすることで変更できる

設定方法 Ubuntu

sudo apt install cpufrequtils

cat /etc/default/cpufrequtils

GOVERNOR="ondemand" <-- ここをperformanceに変更する
ENABLE="true"
MIN_SPEED="1000000"
MAX_SPEED="3000000"
LATENCY_THRESHOLD="10"

設定ファイルの変更後に systemctl でcpufrequtilsを再起動すれば終わり

設定方法 redhat

tunedのパッケージが入っていれば、tuned-admのコマンドが利用できる

sudo tuned-adm profile latency-performance
sudo tuned-adm active

ちなみに設定できる値はlistオプションで確認できる

$ tuned-adm list
Available profiles:
- balanced                    - General non-specialized tuned profile
- desktop                     - Optimize for the desktop use-case
- hpc-compute                 - Optimize for HPC compute workloads
- latency-performance         - Optimize for deterministic performance at the cost of increased power consumption
- network-latency             - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
- network-throughput          - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks
- powersave                   - Optimize for low power consumption
- throughput-performance      - Broadly applicable tuning that provides excellent performance across a variety of common server workloads
- virtual-guest               - Optimize for running inside a virtual guest
- virtual-host                - Optimize for running KVM guests
Current active profile: latency-performance

まとめ

  • cpu governorの設定を変更する
  • Ubuntuの場合 cpufrequtilsを使う
  • RedHatの場合 tuned-admを使う

オンプレやレンサバでの環境がある場合、設定したほうがいい。
自分の場合はかなり改善された。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?