人気ブログランキング | 話題のタグを見る

What Would Jesus Do?

RDS MySQLでmax_connectionsを変更する

RDS MySQLを利用していてmax_connectionsを変更したい場合があります。
そんな場合は
modify_db_parameter_group
を使用して変更します。

まずは現行のmax_connectionsの確認です。
(m1.largeを利用しているとします。)

mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 640 |
+-----------------+-------+
1 row in set (0.00 sec)

上記から現在640ということが分かります。
この値を1500に変更したい場合は、
下記のようなphpを作成して実行します。

vi rds.php
---------------------------------------------------------------

require_once("./sdk.class.php");

$rds = new AmazonRDS();
$rds->set_region(AmazonRDS::REGION_US_W1);

$response = $rds->modify_db_parameter_group('RDS Name', array(
array(
"ParameterName" => "max_connections",
"ParameterValue" => "1500",
"ApplyMethod" => "immediate"
)
));

var_dump($response);

?>

---------------------------------------------------------------

mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 1500 |
+-----------------+-------+
1 row in set (0.00 sec)

再度確認すると1500に変更されていることが確認できます。



by cimacoppi | 2011-08-29 14:32

クラウド・ノイズ
by cimacoppi

検索

最新の記事

mod_line_editを..
at 2012-12-14 22:25
nagiosでOracleの..
at 2012-12-13 12:25
s3cmdでmultipar..
at 2012-12-06 15:59
tcpservr をssl化する
at 2012-03-10 21:50
telnetコマンドでpop..
at 2012-03-06 15:59

最新のトラックバック

ファン

ブログジャンル

画像一覧