1
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?

TunedのOracle Database用プロファイルを試す

Last updated at Posted at 2020-08-24

Red Hat Enterprise Linux / CentOSのチューニング機能にTunedがあります。Tunedはプロファイルを選択することで典型的なワークロードに適したチューニングを行うことができます。この記事ではOracle Database用のプロファイルoracleを使ってどのような設定が行われるのかを検証します。

インストール

Oracle Database用のプロファイルはtuned-profiles-oracleパッケージで提供されます。下記の例ではCentOS 8.2に対してtuned-profiles-oracle-2.13.0-6.el8パッケージを導入しています。

# rpm -ivh tuned-profiles-oracle-2.13.0-6.el8.noarch.rpm
warning: tuned-profiles-oracle-2.13.0-6.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:tuned-profiles-oracle-2.13.0-6.el################################# [100%]
#

インストールが完了すると、以下のファイルが作成されます。

ディレクトリ ファイル 説明
/usr/lib/tuned/oracle tuned.conf Oracle Database用プロファイル設定
/usr/share/man/man7 tuned-profiles-oracle.7.gz オンライン・マニュアル

インストールを確認するにはtuned-admコマンドを実行します。一覧にoracleプロファイルが確認できます。

# tuned-adm list
Available profiles:
- accelerator-performance     - Throughput performance based tuning with disabled higher latency STOP states
- balanced                    - General non-specialized tuned profile
- desktop                     - Optimize for the desktop use-case
- hpc-compute                 - Optimize for HPC compute workloads
- intel-sst                   - Configure for Intel Speed Select Base Frequency
- 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
- oracle                      - Optimize for Oracle RDBMS
- 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: virtual-guest
#

プロファイルの設定

仮想環境におけるデフォルトのプロファイルはvirtual-guestです。現在のプロファイルを確認するには、tuned-adm activeコマンドを実行します。oracleプロファイルに変更する場合はtuned-adm profile oracleコマンドを実行します。下記の例ではプロファイルの変更により、カーネル・パラメータvm.swappinessがどのように変化するかを確認しています。

# tuned-adm active
Current active profile: virtual-guest
# sysctl -a | grep swappiness
vm.swappiness = 30
# tuned-adm profile oracle
# sysctl -a | grep swappiness
vm.swappiness = 10
#

virtual-guestとの違い

デフォルトのプロファイルvirtual-guestとoracleがどのように違うかを確認します。プロファイルの定義ファイルは/usr/lib/tuned/virtual-guest/tuned.confと/usr/lib/tuned/oracle/tuned.confです。どちらもthroughput-performanceプロファイルをインクルードしているため、違いはカーネル・パラメーターとトランスペアレントHugePagesの設定のみとなります。

カーネル・パラメータ virtual-guest oracle 備考
fs.aio-max-nr - 1048576 Oracle Databaseインストール要件
fs.file-max - 6815744 Oracle Databaseインストール要件
kernel.panic_on_oops - 1
kernel.sem - 250 32000 100 128 Oracle Databaseインストール要件
kernel.shmall - 1073741824 Oracle Databaseインストール要件以上
kernel.shmmax - 4398046511104 Oracle Databaseインストール要件以上
kernel.shmmni - 4096 Oracle Databaseインストール要件
net.core.rmem_default - 262144 Oracle Databaseインストール要件
net.core.rmem_max - 4194304 Oracle Databaseインストール要件
net.core.wmem_default - 262144 Oracle Databaseインストール要件
net.core.wmem_max - 1048576 Oracle Databaseインストール要件
net.ipv4.ip_local_port_range - 9000 65499 Oracle Databaseインストール要件
vm.dirty_background_ratio - 3
vm.dirty_expire_centisecs - 500
vm.dirty_ratio 30 40
vm.dirty_writeback_centisecs - 100
vm.swappiness 30 10
vm設定 virtual-guest oracle 備考
transparent_hugepages - never Oracle Databaseインストール推奨値

oracleプロファイルのファイル内容

/usr/lib/tuned/oracle/tuned.conf ファイルの内容です。

#
# tuned configuration
#

[main]
summary=Optimize for Oracle RDBMS
include=throughput-performance

[sysctl]
vm.swappiness = 10
vm.dirty_background_ratio = 3
vm.dirty_ratio = 40
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65499
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
kernel.panic_on_oops = 1

[vm]
transparent_hugepages=never

マニュアル

システムの状態とパフォーマンスの監視と管理-2.3. RHEL と一緒に配布される TUNED プロファイル

1
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
1
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?