2017/9/7 db tech showcase Tokyo 2017(JPOUG in 15 minutes)にて発表した内容です。
SQL大量発行に伴う処理遅延は、ミッションクリティカルシステムでありがちな性能問題のひとつです。
SQLをまとめて発行したり、処理の多重度を上げることができれば高速化可能です。ですが・・・
AP設計に起因する性能問題のため、開発工程の終盤においては対処が難しいことが多々あります。
そのような状況において、どのような改善手段があるのか、Oracleを例に解説します。
2017/9/7 db tech showcase Tokyo 2017(JPOUG in 15 minutes)にて発表した内容です。
SQL大量発行に伴う処理遅延は、ミッションクリティカルシステムでありがちな性能問題のひとつです。
SQLをまとめて発行したり、処理の多重度を上げることができれば高速化可能です。ですが・・・
AP設計に起因する性能問題のため、開発工程の終盤においては対処が難しいことが多々あります。
そのような状況において、どのような改善手段があるのか、Oracleを例に解説します。
This session, led by James Hamilton, VP and Distinguished Engineer, gives an insider view of some the innovations that help make the AWS cloud unique. He will show examples of AWS networking innovations from the interregional network backbone, through custom routers and networking protocol stack, all the way down to individual servers. He will show examples from AWS server hardware, storage, and power distribution and then, up the stack, in high scale streaming data processing. James will also dive into fundamental database work AWS is delivering to open up scaling and performance limits, reduce costs, and eliminate much of the administrative burden of managing databases. Join this session and walk away with a deeper understanding of the underlying innovations powering the cloud.
This session, led by James Hamilton, VP and Distinguished Engineer, gives an insider view of some the innovations that help make the AWS cloud unique. He will show examples of AWS networking innovations from the interregional network backbone, through custom routers and networking protocol stack, all the way down to individual servers. He will show examples from AWS server hardware, storage, and power distribution and then, up the stack, in high scale streaming data processing. James will also dive into fundamental database work AWS is delivering to open up scaling and performance limits, reduce costs, and eliminate much of the administrative burden of managing databases. Join this session and walk away with a deeper understanding of the underlying innovations powering the cloud.
7. 高負荷の時はスケールアウトする
Elastic Load
Balancing
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
お金で解決する!
41. 負荷試験対象システム全体像
クラウド上でスケール可能なシステムを構成
Elastic Load
Balancing
Availability Zone Availability Zone
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
• LAMP構成のシステム
• WEBアプリケーションサーバはLBの後ろに設
置されている
• 全てAZ(データセンター)をまたいだ形で設置
し、単一障害点はない
• キャッシュを利用
• DBはスケールアップで対応
ElastiCache
ElastiCache
45. Elastic Load
Balancing
Availability Zone Availability Zone
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
ElastiCache
ElastiCache
Step1 負荷試験ツールの試験を行う
攻撃サーバ = 攻撃されるサーバ
Webサーバ1台だけ
静的リソースファイルへのアクセス
※この時Localhostへの攻撃をするようにします。
EC2 instance
web app
server
Index.html
.html
48. Step.2 フレームワークに負荷をかける
Elastic Load
Balancing
Availability Zone Availability Zone
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
ElastiCache
ElastiCache
攻撃サーバ = 攻撃されるサーバ
EC2 instance
web app
server
Webサーバ1台だけ
フレームワークの機能を利用した上で最低
限のHellowWorldでの試験を行う
この時にまだ外部のリソースを利用しない
HellowWorld.php
.php
51. Step.3 参照系のシステムに負荷をかける
Elastic Load
Balancing
Availability Zone Availability Zone
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
攻撃サーバ = 攻撃されるサーバ
EC2 instance
web app
server
.php
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
ElastiCache
ElastiCache
参照.php
Webサーバ1台だけ
DBに対して参照のみ行われるケースの試験
54. Webサーバ1台だけ
DBに対して
参照、更新の両方が行われるケースの試験
Elastic Load
Balancing
Availability Zone Availability Zone
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
攻撃サーバ = 攻撃されるサーバ
EC2 instance
web app
server
.php
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
ElastiCache
ElastiCache
更新.php
Step.4 更新系のシステムに負荷をかける
66. Step.2 スケールアップ・スケールアウト
可能なシステムであることを確認する
Availability Zone
Availability Zone
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
ElastiCache
ElastiCache
軽い☺
重い(*_*) 負荷のかかっているリソースを増強する
※殆どの場合WebサーバCPUリソース
軽い☺
スループット
500req/sec
Elastic Load
Balancing
67. Step.2 スケールアップ・スケールアウト
可能なシステムであることを確認する
Availability Zone
Availability Zone
EC2 instance
web app
server
EC2 instance
web app
server
EC2 instance
web app
server
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
ElastiCache
ElastiCache
負荷のかかっているリソースを増強する
軽い☺
スループット
1000req/sec
Elastic Load
Balancing
EC2 instance
web app
server
普通☺
重い(*_*)
68. Step.2 スケールアップ・スケールアウト
可能なシステムであることを確認する
Availability Zone
Availability Zone
EC2 instance
web app
server
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
ElastiCache
ElastiCache
負荷のかかっているリソースを増強する
2倍づつが良い。
軽い☺
スループット
1500req/sec
Elastic Load
Balancing
EC2 instance
web app
server
重い(*_*)
2000req/secにならないぞ?
EC2 instance
web app
server
web app
server
EC2 instance
普通☺
69. Step.2 スケールアップ・スケールアウト
可能なシステムであることを確認する
Availability Zone
Availability Zone
EC2 instance
web app
server
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
ElastiCache
ElastiCache
普通☺
DBをスケールアップ
軽い☺
スループット
2000req/sec
Elastic Load
Balancing
EC2 instance
web app
server
EC2 instance EC2 instance
web app
server
web app
server
重い(*_*)
96. EC2 instance
web app
server
EC2 instance
web app
server
攻撃元が遠いとダメ(失敗例)
Elastic Load
Balancing
RDS DB
instance
RDS DB
instance
standby
(Multi-AZ)
ElastiCache
ElastiCache
攻撃されるサーバ
EC2 instance
web app
server
EC2 instance
web app
server
攻撃サーバ
AZをまたいでの負荷試験はほぼ無意味
スループットは上がらないのに、リソースが
余るという状況が発生する。
ネットワークの試験になるだけでなく、一部
の遅いプロセスが全部終わるまで試験が終
わらないために、攻撃対象サーバに負荷が
かからない。
Availability Zone Availability Zone