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?

More than 1 year has passed since last update.

Amazon EC2 で利用するDataKeeper のパフォーマンスを測定してみました。

Last updated at Posted at 2023-08-25

AWS環境でLifeKeeper for Linuxを利用する場合、クラスター間でのデータ共有にDataKeeperを使用したレプリケーションを行います。このレプリケーションはネットワークを経由して書き込みデータの転送をリアルタイムで行うため、一般的に書き込み速度が下がる傾向にあります。また、同じレプリケーションでもハードウェア、プラットフォームなどの環境の差でもネットワーク帯域によって性能面に影響が出ると考えられます。

テスト環境

今回はこのレプリケーションによって実現した共有ディスクに対しての書き込みパフォーマンスを、RedHat 系のOSですぐに利用できるfioを使用して測定してみました。

測定する環境は以下のシングルAZとマルチAZ環境で対比を行っています。
2023-07-24 07_50_32-構成図.pptx - PowerPoint.png
シングルAZはAWSのネットワーク大規模障害などで可用性を保てなく無くなるためLifeKeeper/DataKeeperでは非サポートとしていますが、パフォーマンス測定の対比として用意しました。
マルチAZはLifeKeeper/DataKeeperで標準的な構成となるため用意しました。AZを分けることで可用性を高めることはできますが、パフォーマンスは期待が出来ないという話をよく聞くため、実際にどの程度なのかを測定してみます。
パフォーマンス測定に使用したインスタンスは以下となります。シングルAZはclient1c-a,client1c-b間、マルチAZはclient1c-a,client1d間で行いました。
2023-08-10 10_54_33-構成図.pptx - PowerPoint.png
OSやクラスター、測定にしようしたfioのバージョンは以下です。
2023-07-21 08_31_44-Window.png

テスト実施パターン

fio では以下の4パターンのテストをファイルサイズ1,3,6G で実施しました。OSキャッシュをスルーする設定にして、よりディスク性能に近い値を測定できるようにしました。
2023-07-26 09_43_54-構成図.pptx - PowerPoint.png
具体的には以下のスクリプトを実行しました。

fio.sh
# /bin/bash
#シングルAZ ランダムwrite
fio -filename=/fio-test/randfile1g -direct=1 -rw=randwrite -bs=4k -size=1g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-randaom-write -output=Randwrite1G.txt
fio -filename=/fio-test/randfile6g -direct=1 -rw=randwrite -bs=4k -size=3g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-randaom-write -output=Randwrite3G.txt
fio -filename=/fio-test/randfile6g -direct=1 -rw=randwrite -bs=4k -size=6g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-randaom-write -output=Randwrite6G.txt

#シングルAZ シーケンシャルwrite
fio -filename=/fio-test/seqfile1g -direct=1 -rw=write -bs=4k -size=1g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-sequentialwrite -output=Sequentialwrite1G.txt
fio -filename=/fio-test/seqfile3g -direct=1 -rw=write -bs=4k -size=3g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-sequentialwrite -output=Sequentialwrite3G.txt
fio -filename=/fio-test/seqfile6g -direct=1 -rw=write -bs=4k -size=6g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-sequentialwrite -output=Sequentialwrite6G.txt

#マルチAZ ランダムwrite
fio -filename=/fio-test2/randfile1g -direct=1 -rw=randwrite -bs=4k -size=1g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-randaom-write -output=Randwrite1G.txt
fio -filename=/fio-test2/randfile3g -direct=1 -rw=randwrite -bs=4k -size=3g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-randaom-write -output=Randwrite3G.txt
fio -filename=/fio-test2/randfile6g -direct=1 -rw=randwrite -bs=4k -size=6g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-randaom-write -output=Randwrite6G.txt

#マルチAZ シーケンシャルwrite
fio -filename=/fio-test2/seqfile1g -direct=1 -rw=write -bs=4k -size=1g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-sequentialwrite -output=Sequentialwrite1G.txt
fio -filename=/fio-test2/seqfile3g -direct=1 -rw=write -bs=4k -size=3g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-sequentialwrite -output=Sequentialwrite3G.txt
fio -filename=/fio-test2/seqfile6g -direct=1 -rw=write -bs=4k -size=6g -numjobs=8 -runtime=120 -group_reporting -name=TestProgram1-io-perf-sequentialwrite -output=Sequentialwrite6G.txt

パフォーマンス測定結果

今回はレプリケーションディスクの性能を確認したいため、ディスクIO,スループットについて比較しました。以下は、インスタンスタイプ t2.smallを使用したシングルAZ間でのランダム書き込み、シーケンシャル書き込み、マルチAZ間でのランダム書き込み、シーケンシャル書き込みの結果です。

t2.small
2023-07-24 02_52_59-構成図.pptx - PowerPoint.png
シングルAZとマルチAZでは、Random書き込み、Sequential書き込みともに明確に差が出ることが分かりました。特に試行回数を増やしてみても、シングルAZとマルチAZの差に変化は見られませんでした。

マルチAZ間のレプリケーションに遅延が発生するのは、利用しているインスタンスタイプ(t2.small)のネットワーク速度の影響があると考え、以下のタイプに変更して同じ検証結果を取得しました。

t3.medium
2023-08-10 10_29_57-構成図.pptx - PowerPoint.png
確認したところ、インスタンスタイプによっては以下のような差がありました。

インスタンス vCPU* CPU クレジット/時間 メモリ (GiB) ストレージ ネットワークパフォーマンス
t2.small 1 12 2 EBS のみ 低~中
t3.medium 2 24 4 EBSのみ 最大5G

t3.mediumに変更することで、シングルAZとマルチAZのシーケンシャル書き込み(seq write)に差が無くなりました。また、1G,3Gファイルへのランダム書き込みでも差は殆ど確認できませんでした。

まとめ

シングルAZとマルチAZでは物理的な距離に差が出るため、シングルAZがパフォーマンスとして優位なのは確かなようですが、利用するインスタンスのパフォーマンスによっては差分の殆どない環境を実現が可能と考えられます。
OSバンドルのfioはシンプルなIO計測が可能なツールとなっています。お客様毎に利用するファイルサイズやインスタンスタイプによっては結果が変わってくると考えられますので、上記の結果は参考程度にしかなりません。皆様も現在ご利用の環境でも試してみてはいかがでしょうか。

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?