plone + aws at plone symposium tokyo 2015

Post on 27-Jul-2015

339 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

株式会社CMSコミュニケーションズ

1

Plone + AWS スケールアウト可能な

ハイパフォーマンスPloneサイトを クラウドに構築Manabu TERADA

2015/6/13

Plone Symposium Tokyo 2015

株式会社CMSコミュニケーションズ

@terapyon

Owner of CMS communications Inc.

Chair of PyCon APAC 2013 in Japan

Plone Foundation Ambassador

Member of NVDA Japanese Team

About me株式会社CMSコミュニケーションズ

Manabu TERADA

We use Plone for building web site

Universities, Public institutions

Engineering company

Supporting education tools

CMScom

2

Case Study by us株式会社CMSコミュニケーションズ

http://www.osaka-u.ac.jp/

http://todai.tv/

http://www.osaka-cu.ac.jp/

http://ocw.kyoto-u.ac.jp/

http://ocw.osaka-u.ac.jp/

https://crdeg2.cf.ocha.ac.jp/ocha/plone

https://my.osaka-u.ac.jp/ (need login)

http://typemoon.com/

3

Case Study by us株式会社CMSコミュニケーションズ 4

Case Study by us株式会社CMSコミュニケーションズ 5

Case Study by us株式会社CMSコミュニケーションズ 6

株式会社CMSコミュニケーションズ

Small system / Large system / System elements システム構成の例

2

3

1System structure for Plone

Contents of this session

How to use AWS? AWSの使いどころなど。

Using Amazon Web Services (AWS)

Motivation

4 Q & A

7

なぜ、何かをしたいのか?

Ploneをホストする上で、どのように何をすべきか。

Speed Up (スピードアップ)

Support of large number of access (大量アクセス)

Cost down (コスト削減)

Flexible system (柔軟なシステム)

Motivation株式会社CMSコミュニケーションズ 8

System structure (minimum)株式会社CMSコミュニケーションズ 9

Plone (スタンドアローン)

1台の物理サーバ又はクラウドサーバ管理者

管理用アクセス パスワード必要

Apache (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

ZODB (データベースサーバ)

閲覧者

閲覧者

System structure (Large system)株式会社CMSコミュニケーションズ 10

管理者

nginx (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

MySQL/PostgreSQL (スレーブ)

(データベースサーバ)

閲覧者

閲覧者

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Apache (Webサーバ)(ログイン用)

Varnish (キャッシュサーバ)

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Varnish (キャッシュサーバ)

HAProxy (ロードバランサ)

MySQL/PostgreSQL (マスター)

(データベースサーバ)

Memcached (一時保存ファイル)

LDAP (ユーザディレクトリ)

外部SSO 認証サーバ

CDN

System structure (Middle size)株式会社CMSコミュニケーションズ 11

管理者管理用アクセス パスワード必要nginx (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

ZODB (データベースサーバ)

閲覧者

閲覧者

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Apache (Webサーバ)(ログイン用)Varnish (キャッシュサーバ)

株式会社CMSコミュニケーションズ 12

海外からもゲストが来ます。

nginx or Apache

フロントエンドでリクエストを受る

バーチャルホストやSSLを担当

構成要素の説明 (structural element)

Webサーバ

HAProxy

セッションを維持した振り分け

ロードバランス

Varnish

HTML / CSS / 画像などをキャッシュ

ロードバランシング機能

キャッシュサーバ

CloudFront や アカマイ

静的なコンテンツを別ネットワークから

CDN

System structure (Large system)株式会社CMSコミュニケーションズ 13

管理者

nginx (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

MySQL/PostgreSQL (スレーブ)

(データベースサーバ)

閲覧者

閲覧者

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Apache (Webサーバ)(ログイン用)

Varnish (キャッシュサーバ)

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Varnish (キャッシュサーバ)

HAProxy (ロードバランサ)

MySQL/PostgreSQL (マスター)

(データベースサーバ)

Memcached (一時保存ファイル)

LDAP (ユーザディレクトリ)

外部SSO 認証サーバ

CDN

株式会社CMSコミュニケーションズ 14

海外からもゲストが来ます。

Zope / Plone サーバ

メモリとCPUを消費

ZEOで複数のアプリケーションサーバ

構成要素の説明 (structural element)

アプリケーションサーバ

memchaced

関数・メソッドをキャッシュ

Zope再起動でキャッシュを消さない

メモリキャッシュ

ZODB

Data.fs と blob

データベース

RelStorage / NEO

MySQL / PostgreSQL

その他のデータベース

System structure (Large system)株式会社CMSコミュニケーションズ 15

管理者

nginx (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

MySQL/PostgreSQL (スレーブ)

(データベースサーバ)

閲覧者

閲覧者

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Apache (Webサーバ)(ログイン用)

Varnish (キャッシュサーバ)

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Varnish (キャッシュサーバ)

HAProxy (ロードバランサ)

MySQL/PostgreSQL (マスター)

(データベースサーバ)

Memcached (一時保存ファイル)

LDAP (ユーザディレクトリ)

外部SSO 認証サーバ

CDN

Webサーバ ・・・ nginxを使いましょう

キャッシュサーバ・・・Varnishをきちんとセットアップ

Plone 4 からのデフォルトblob化で効果あり

ZEO・・・負荷が高いのであれば導入検討

メモリキャッシュ・・・ZEOでキャッシュ共有可能

ZODBチューニングは難しいので、RelStrageなどを検討

キャッシュのチューニング/パージは、plone.app.caching

を設定

構成要素のまとめ株式会社CMSコミュニケーションズ 16

Using Amazon Web Services (AWS)株式会社CMSコミュニケーションズ 17

EC2

RDS

EBS

CloudFront

ElastiCacheS3

R53

System structure (on AWS)株式会社CMSコミュニケーションズ 18

管理者

nginx (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

MySQL/PostgreSQL (スレーブ)

(データベースサーバ)

閲覧者

閲覧者

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Apache (Webサーバ)(ログイン用)

Varnish (キャッシュサーバ)

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Varnish (キャッシュサーバ)

HAProxy (ロードバランサ)

MySQL/PostgreSQL (マスター)

(データベースサーバ)

Memcached (一時保存ファイル)

LDAP (ユーザディレクトリ)

外部SSO 認証サーバ

CDNEC2

System structure (on AWS)株式会社CMSコミュニケーションズ 19

管理者

nginx (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

MySQL/PostgreSQL (スレーブ)

(データベースサーバ)

閲覧者

閲覧者

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Apache (Webサーバ)(ログイン用)

Varnish (キャッシュサーバ)

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Varnish (キャッシュサーバ)

HAProxy (ロードバランサ)

MySQL/PostgreSQL (マスター)

(データベースサーバ)

Memcached (一時保存ファイル)

LDAP (ユーザディレクトリ)

外部SSO 認証サーバ

CDNDB

System structure (on AWS)株式会社CMSコミュニケーションズ 20

管理者

nginx (Webサーバ)

Ploneコアシステム(アプリケーションサーバ)

MySQL/PostgreSQL (スレーブ)

(データベースサーバ)

閲覧者

閲覧者

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Apache (Webサーバ)(ログイン用)

Varnish (キャッシュサーバ)

Ploneコアシステム(アプリケーションサーバ)

Ploneコアシステム(アプリケーションサーバ)

Varnish (キャッシュサーバ)

HAProxy (ロードバランサ)

MySQL/PostgreSQL (マスター)

(データベースサーバ)

Memcached (一時保存ファイル)

LDAP (ユーザディレクトリ)

外部SSO 認証サーバ

CDNCDN

Using Amazon Web Services (AWS)株式会社CMSコミュニケーションズ 21

EC2

RDS

EBS

CloudFront

ElastiCacheS3

EFS

R53

株式会社CMSコミュニケーションズ

Small system / Large system / System elements システム構成の例

2

3

1System structure for Plone

Summary of this session

How to use AWS? AWSの使いどころなど。

Using Amazon Web Services (AWS)

Motivation

22

なぜ、何かをしたいのか?

One More thing

株式会社CMSコミュニケーションズ 23

Using CDN

株式会社CMSコミュニケーションズ 24

Only a few changing on

nginx config

Server Setting株式会社CMSコミュニケーションズ 25

System structure w/o CDN株式会社CMSコミュニケーションズ 26

nginx Varnish

Plone1

Plone2

Plone3

System structure w/ CDN株式会社CMSコミュニケーションズ 27

nginx Varnish

Plone1

Plone2

Plone3

CDN CloudFront

nginx Config株式会社CMSコミュニケーションズ 28

location / { if ($uri ~* \.(jpe?g|png|gif|pdf|gz|tgz|bz2|tbz|zip|tiff|tif)$) { set $no_plone A; } if ($uri ~* /(image|(image_(?:[^/]|(?!view.*).+)))$) { set $no_plone A; } if ($uri ~* \.(svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv|flv)$) { set $no_plone A; } if ($uri ~* \.(css|js)$) { set $no_plone A; } if ( $http_user_agent != "Amazon CloudFront" ) { set $no_plone "${no_plone}B"; } if ($no_plone = AB) { expires 1h; rewrite ^ http://YOUR_SUBDOMAIN.cloudfront.net$request_uri? last; } proxy_pass http://to_varnish/VirtualHostBase/http/YOUR_DOMAIN:80/Plone/VirtualHostRoot/; }

Data delivery first time株式会社CMSコミュニケーションズ 29

nginx Varnish

Plone1

Plone2

Plone3

CDN CloudFront

1

Redirect

2

3 4

56

7

8

Data delivery株式会社CMSコミュニケーションズ 30

nginx Varnish

Plone1

Plone2

Plone3

CDN CloudFront

1

Redirect

2

Other usage

株式会社CMSコミュニケーションズ 31

Streaming video株式会社CMSコミュニケーションズ

Streaming video with access control by Plone login

CloudFront provides Streaming and one time URL

system. https://bitbucket.org/cmscom/c2.app.streamingaws

32

サンプル株式会社CMSコミュニケーションズ 33

Thank youCMSPlone

株式会社CMSコミュニケーションズ 34

Q&ACMSPlone

株式会社CMSコミュニケーションズ

4

35

top related