# RDS のパラメータグループの仕組み

更新日 2026年11月17日 · [ガイドの執筆と確認の方法](https://cloudconsole.dev/ja/editorial)

**要点**

DB パラメータグループは、RDS インスタンスのエンジンの設定を保持します。デフォルトのグループは変更できないため、適切なファミリー（たとえば mysql8.0 や postgres16）のカスタムグループを作成し、そこでパラメータを変更してインスタンスに関連付けます。動的パラメータはすぐに適用されます。静的パラメータと、新しく関連付けたグループは、再起動のあとでしか有効にならず、それまでインスタンスは pending-reboot と表示されます。グループの変更は、それを使うすべてのインスタンスに影響します。

Diagram: 図：パラメータの変更が有効になるタイミング。動的パラメータ：カスタムグループで変更 → すぐに適用…

## 主な概念

| 概念 | 意味 |
|---|---|
| デフォルトのパラメータグループ（`default.mysql8.0`） | 読み取り専用。カスタムグループなしで作成したインスタンスはすべてこれを使う |
| カスタム DB パラメータグループ | 編集できるデフォルトのコピー。1 つのファミリーに紐づく |
| ファミリー | エンジンとメジャーバージョン（`mysql8.0`、`postgres16`）。メジャーバージョンのアップグレードには新しいファミリーのグループが必要 |
| 動的パラメータ | 関連付けたすべてのインスタンスにすぐ適用される（`ApplyMethod=immediate`） |
| 静的パラメータ | 各インスタンスを再起動してから適用される（`pending-reboot`） |
| 数式の値 | `{DBInstanceClassMemory/12582880}` のようなデフォルト値はインスタンスのサイズに比例する |
| DB クラスターパラメータグループ | マルチ AZ DB クラスターと Aurora 用。クラスター全体の設定 |

新しいグループのインスタンスへの関連付けはすぐに行われますが、その値（静的も動的も）が適用されるのは次の再起動のあとです。

## よく変更されるパラメータ

| エンジン | パラメータ | 理由 |
|---|---|---|
| MySQL | `max_connections` | 通常は数式のままにする。[最大接続数 (EN)](https://cloudconsole.dev/limits/rds-max-connections)を参照 |
| MySQL | `slow_query_log`, `long_query_time` | 遅いクエリを見つける（動的） |
| MySQL | `wait_timeout`, `interactive_timeout` | アイドル状態の接続を閉じる |
| MySQL | `binlog_format` | レプリケーションのツールの要件 |
| PostgreSQL | `log_min_duration_statement` | 遅いステートメントをログに出す（動的） |
| PostgreSQL | `idle_in_transaction_session_timeout` | 開いたトランザクションで止まったセッションを終了する |
| PostgreSQL | `shared_preload_libraries` | `pg_stat_statements` などの拡張機能を読み込む（静的） |
| PostgreSQL | `rds.force_ssl` | TLS 接続を必須にする |
| PostgreSQL | `max_connections`, `work_mem` | 接続ごと、ソートごとのメモリ。慎重に変更する |

## 作成、変更、適用

```
# Create a custom group and attach it
aws rds create-db-parameter-group --db-parameter-group-name app-postgres16 \
  --db-parameter-group-family postgres16 --description "orders-db settings"

aws rds modify-db-parameter-group --db-parameter-group-name app-postgres16 \
  --parameters "ParameterName=log_min_duration_statement,ParameterValue=500,ApplyMethod=immediate" \
               "ParameterName=shared_preload_libraries,ParameterValue=pg_stat_statements,ApplyMethod=pending-reboot"

aws rds modify-db-instance --db-instance-identifier orders-db \
  --db-parameter-group-name app-postgres16 --apply-immediately

# Is a reboot pending?
aws rds describe-db-instances --db-instance-identifier orders-db \
  --query 'DBInstances[0].DBParameterGroups[].[DBParameterGroupName,ParameterApplyStatus]'

# What you changed from the defaults
aws rds describe-db-parameters --db-parameter-group-name app-postgres16 --source user \
  --query 'Parameters[].[ParameterName,ParameterValue,ApplyType]' --output table
```

静かな時間帯に再起動するか、次のメンテナンスウィンドウに任せます。マルチ AZ のインスタンスはフェイルオーバー付きで再起動し、停止時間を短くできます。

**CloudFormation：**`Family`、`Description`、`Parameters`（名前と値のマップ）を持つ `AWS::RDS::DBParameterGroup` を、`AWS::RDS::DBInstance` の `DBParameterGroupName` で参照します。**Terraform：**`family` と `parameter { name, value, apply_method }` を持つ `aws_db_parameter_group` を、`aws_db_instance` の `parameter_group_name` で参照します。

## 障害を招く間違い

- **共有のグループ：**本番とステージングで 1 つのカスタムグループを使うと、「ステージング」の変更が本番に及びます。環境やワークロードごとにグループを分けましょう。
- **忘れられた pending-reboot：**静的な変更は、誰かが再起動するかメンテナンスが走るまで黙って待ち、そのときに予期せず動作を変えます。変更のたびに `ParameterApplyStatus` を確認しましょう。
- **メモリを多く使う値：**`max_connections`、`work_mem`、バッファのサイズをインスタンスのメモリを超えて引き上げると、インスタンスが起動できず [incompatible-parameters](https://cloudconsole.dev/errors/rds-incompatible-parameters) の状態になることがあります。
- **メジャーアップグレード：**新しいファミリーのパラメータグループを作成して指定しないと、アップグレードが失敗するか、デフォルト値が使われます。
- **固定の数値：**大きなインスタンスに合わせた固定の `max_connections` は、スケールダウン後に危険になります。数式ならインスタンスのサイズに追従します。

## よくある質問

### RDS のデフォルトのパラメータグループは変更できますか？

いいえ。デフォルトのパラメータグループは読み取り専用です。カスタムのパラメータグループを作成して変更し、DB インスタンスに関連付けます。

### RDS インスタンスが pending-reboot と表示されるのはなぜですか？

静的パラメータを変更したか、新しいパラメータグループを関連付けたためです。変更はインスタンスを再起動してから適用されます。

### RDS のパラメータグループのファミリーとは何ですか？

グループが適用されるエンジンとメジャーバージョンで、mysql8.0 や postgres16 などです。グループはそのファミリーのインスタンスでしか使えません。

**デスクを離れているときに起きたら**

再起動を待つパラメータの変更は、何週間もあとのメンテナンス中に誰かを驚かせがちです。AWS 用のスマホアプリ CloudConsole は、RDS のイベントとアラームをスマホで確認できるよう開発中です。

[アプリについて →](https://cloudconsole.dev/ja/aws-console-app) · [App Storeからダウンロード](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## 出典

- [Parameter groups for Amazon RDS (overview)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/parameter-groups-overview.html)
- [Modifying parameters in a DB parameter group](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.Modifying.html)
- [AWS::RDS::DBParameterGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-rds-dbparametergroup.html)

## 関連ページ

- [RDS max connections by engine and instance class (EN)](https://cloudconsole.dev/limits/rds-max-connections) – AWS の制限とクォータ
- [RDS instance in incompatible-parameters state (EN)](https://cloudconsole.dev/errors/rds-incompatible-parameters) – AWSのエラーを解決
- [How to reboot an RDS instance (EN)](https://cloudconsole.dev/how-to/reboot-rds-instance) – ハウツーガイド
- [aws rds modify-db-instance (EN)](https://cloudconsole.dev/cli/rds-modify-db-instance) – AWS CLI コマンド
- [aws rds reboot-db-instance (EN)](https://cloudconsole.dev/cli/rds-reboot-db-instance) – AWS CLI コマンド
- [RDS backup retention period, backup window and maintenance window (EN)](https://cloudconsole.dev/config/rds-backup-and-maintenance-window) – AWS の設定

---

Source: https://cloudconsole.dev/ja/config/rds-parameter-groups

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
