LoginSignup
0
0

More than 1 year has passed since last update.

Aurora Serverless V2を使ってみた感想(まだ商用ではないかも。。)

Last updated at Posted at 2022-06-16

初めまして

初めまして、都内でクラウドエンジニアをやっている平野です。
今回は初投稿として、AuroraServerlessV2を利用してみました。

構成

image.png
この構成を
image.png
こんな感じにします。

やること

1. Zabbixサーバーを停止する

sudo systemctl stop zabbix-server

2. Webサーバーも停止する

sudo systemctl stop httpd
sudo systemctl stop php-fpm

3. RDSをAuroraServerlessV2に変更する

スナップショットを取り、Aurora DB Clusterを作成する。

aws rds create-db-snapshot --db-snapshot-identifier zabbix-db --db-instance-identifier zabbix-db-snapshot
aws rds restore-db-cluster-from-snapshot --db-cluster-identifier zabbix-db-cluster --snapshot-identifier zabbix-db-snapshot
--engine aurora-postgresql

PostgreSQL 13.10にバージョンを上げてServerlessインスタンスを追加する。

aws rds modify-db-cluster --db-cluster-identifier zabbix-db-cluster --engine-version 13.10

クラスタ設定でとりあえず、ACUの設定を行う(0.5~4)

aws rds modify-db-cluster --db-cluster-identifier zabbix-db-cluster --serverless-v2-scaling-configuration MinCapacity=0.5,MaxCapacity=4

サーバーレスインスタンスの追加

aws rds create-db-instance --db-instance-identifier zabbix-db-cluster-instance-01 --db-cluster-identifier zabbix-db-cluster --db-instance-class db.serverless 

4. ZabbixのDB設定を変更する。

/etc/zabbix/zabbix_server.conf

DBHost=クラスタのリードエンドポイント

/etc/zabbix/web/zabbix.conf.php

$DB['SERVER']   = 'クラスタのリードエンドポイント'; 

5.Zabbixを起動

sudo systemctl start zabbix-server

6. Webサーバーも起動する

sudo systemctl start php-fpm
sudo systemctl start httpd

最後に

ACUをコスト的に考えてvCPU1のACU4 を上限とした場合、勝手に落ちる事象が発生した。(07:30頃)
AWSにチケットを切って質問したところACUを上げたら落ちないかもしれないとの情報を得た。
(追記:2022/06/24 ACU上限をついていかったが、起動時に100%だったための判断か・・そもそも、Insertがたまっているので再起動するとACUがある程度高く設定していても100%になる。ACU負荷が50%程度の時に落ちている。画像はないが、1秒のメトリックスでも突然死前に急上昇をモニタ出来ていない)

クラスタ設定でとりあえず、ACUの設定を行う(0.5~4)

aws rds modify-db-cluster --db-cluster-identifier zabbix-db-cluster --serverless-v2-scaling-configuration MinCapacity=0.5,MaxCapacity=8
上限をACU 8にしたところ、勝手に落ちる事象は発生しなくなった。また、ACUの一日平均が1.7が1.2程度になり、結果的にコストを抑えることができた。

image.png

ただあげても、基盤負荷のピークか何かのタイミングで連続して停止していまう問題が発生。リーダーインスタンスとしてサーバーレスを使うのもありかもしれないが、なぜか12ACU上限設定で負荷0にもかかわらずACU8をキープしていたので、結果的にdb.r6g.largeにした。

まとめると(追記:2022/06/24)

  • 負荷に対して結構リアルタイムでACUがスケールする。
  • ACU上限が低いと再起動する(らしい)
  • リーダーでもなんかACUが高い。

フェールオーバーが多発しても許容できる環境であれば、使えるかもしれない。1ACU=0.2USD/hは高いのでSavings Planなどが対象で、突然死がなければサーバーレスインスタンスがスモールスタートPJのスタンダードになるかもしれない。

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