Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
EN
Uploaded by
Masashi Shinbara
15,384 views
Azure Websites で作るスケーラブルな PHP アプリケーション
2015/01/16 GoAzure 2015
Technology
◦
Read more
7
Save
Share
Embed
Embed presentation
Download
Downloaded 26 times
1
/ 63
2
/ 63
3
/ 63
4
/ 63
5
/ 63
6
/ 63
7
/ 63
8
/ 63
9
/ 63
10
/ 63
11
/ 63
12
/ 63
13
/ 63
14
/ 63
15
/ 63
16
/ 63
17
/ 63
18
/ 63
19
/ 63
20
/ 63
21
/ 63
22
/ 63
23
/ 63
24
/ 63
25
/ 63
26
/ 63
27
/ 63
28
/ 63
29
/ 63
30
/ 63
31
/ 63
32
/ 63
33
/ 63
34
/ 63
35
/ 63
36
/ 63
37
/ 63
38
/ 63
39
/ 63
40
/ 63
41
/ 63
42
/ 63
43
/ 63
44
/ 63
45
/ 63
46
/ 63
47
/ 63
48
/ 63
49
/ 63
50
/ 63
51
/ 63
52
/ 63
53
/ 63
54
/ 63
55
/ 63
56
/ 63
57
/ 63
58
/ 63
59
/ 63
60
/ 63
61
/ 63
62
/ 63
63
/ 63
More Related Content
PDF
わかってるフレームワーク Laravel
by
Masashi Shinbara
PDF
Heroku で作る スケーラブルな PHP アプリケーション
by
Masashi Shinbara
PDF
開発現場で活用するVagrant
by
Masashi Shinbara
PDF
Vagrant体験入門
by
Masashi Shinbara
PDF
いまどきのPHP
by
Masashi Shinbara
PDF
Laravel ユーザなら知っておくべきAuthオートログイン
by
Masashi Shinbara
PDF
Vagrant で作る PHP 開発環境 [実践編]
by
Masashi Shinbara
PDF
認証機能で学ぶ Laravel 5 アプリケーション
by
Masashi Shinbara
わかってるフレームワーク Laravel
by
Masashi Shinbara
Heroku で作る スケーラブルな PHP アプリケーション
by
Masashi Shinbara
開発現場で活用するVagrant
by
Masashi Shinbara
Vagrant体験入門
by
Masashi Shinbara
いまどきのPHP
by
Masashi Shinbara
Laravel ユーザなら知っておくべきAuthオートログイン
by
Masashi Shinbara
Vagrant で作る PHP 開発環境 [実践編]
by
Masashi Shinbara
認証機能で学ぶ Laravel 5 アプリケーション
by
Masashi Shinbara
What's hot
PDF
Vagrant で PHP 開発環境を作る ハンズオン
by
Masashi Shinbara
PDF
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
by
Masashi Shinbara
PDF
PHPコードではなく PHPコードの「書き方」を知る
by
Masashi Shinbara
PDF
Twilio API を PHP で触ってみよう
by
Masashi Shinbara
PDF
レイヤードアーキテクチャを意識したPHPアプリケーションの構築
by
Masashi Shinbara
PDF
AWSをコードで定義する
by
Sugawara Genki
PDF
Lambdaによるクラウド型言語の実装
by
Sugawara Genki
PDF
SQLによるDynamoDBの操作
by
Sugawara Genki
PDF
serverless framework + AWS Lambda with Python
by
masahitojp
PDF
20140930 anything as_code
by
Sugawara Genki
PDF
FluentdとRedshiftの素敵な関係
by
moai kids
PDF
Spring Framework / Boot / Data 徹底活用 〜Spring Data Redis 編〜
by
Naohiro Yoshida
PDF
Elixir Meetup #1 Loggerの構造と拡張
by
Sugawara Genki
PDF
DynamoDBのまえにキャッシュおく奴
by
Sugawara Genki
PDF
200k/sec
by
Sugawara Genki
PPTX
イベント駆動プログラミングとI/O多重化
by
Gosuke Miyashita
PDF
Sbtのマルチプロジェクトはいいぞ
by
Yoshitaka Fujii
PDF
Spark Streaming on AWS -S3からKinesisへ-
by
chibochibo
PDF
Kafkaを使った マイクロサービス基盤 part2 +運用して起きたトラブル集
by
matsu_chara
PDF
TokyoWebminig カジュアルなHadoop
by
Teruo Kawasaki
Vagrant で PHP 開発環境を作る ハンズオン
by
Masashi Shinbara
レイヤードアーキテクチャを意識した PHPアプリケーションの構築 ver2
by
Masashi Shinbara
PHPコードではなく PHPコードの「書き方」を知る
by
Masashi Shinbara
Twilio API を PHP で触ってみよう
by
Masashi Shinbara
レイヤードアーキテクチャを意識したPHPアプリケーションの構築
by
Masashi Shinbara
AWSをコードで定義する
by
Sugawara Genki
Lambdaによるクラウド型言語の実装
by
Sugawara Genki
SQLによるDynamoDBの操作
by
Sugawara Genki
serverless framework + AWS Lambda with Python
by
masahitojp
20140930 anything as_code
by
Sugawara Genki
FluentdとRedshiftの素敵な関係
by
moai kids
Spring Framework / Boot / Data 徹底活用 〜Spring Data Redis 編〜
by
Naohiro Yoshida
Elixir Meetup #1 Loggerの構造と拡張
by
Sugawara Genki
DynamoDBのまえにキャッシュおく奴
by
Sugawara Genki
200k/sec
by
Sugawara Genki
イベント駆動プログラミングとI/O多重化
by
Gosuke Miyashita
Sbtのマルチプロジェクトはいいぞ
by
Yoshitaka Fujii
Spark Streaming on AWS -S3からKinesisへ-
by
chibochibo
Kafkaを使った マイクロサービス基盤 part2 +運用して起きたトラブル集
by
matsu_chara
TokyoWebminig カジュアルなHadoop
by
Teruo Kawasaki
Similar to Azure Websites で作るスケーラブルな PHP アプリケーション
PPTX
Windows Azure PHP Tips
by
Microsoft Openness Japan
PDF
OSS on Azure で構築するウェブアプリケーション
by
Daisuke Masubuchi
PDF
PHP on Windows Azure
by
Microsoft
PDF
PHP on Windows Azure
by
Microsoft Openness Japan
PDF
PHP on Windows Azure in Open Source Conference
by
Microsoft
PDF
第3回岡山PHP勉強会
by
Masaki Takeda
PPT
Using Windows Azure
by
Shinji Tanaka
PDF
Windows Azure for PHP Developers
by
fumios
PDF
クラウド時代の Web サイト構築 ~ Windows Azure Web サイト概要 ~
by
Akira Inoue
PPTX
Microsoft azure上にwebサイトやアプリケーションを構築する方法 アドバンスド
by
Kazumi Hirose
PDF
20120731 c4 saリリースパーティlt
by
Kaz Watanabe
PDF
AzureでLaravel動かしてみた
by
Keiji Kamebuchi
PPTX
PHP on Windows Azure Training
by
Microsoft Openness Japan
PDF
Web appsとcleardbで作る簡単webサイト
by
Tsukasa Kato
PPTX
PHP 開発環境構築- Windows 編 -
by
Masaki Takeda
PPTX
Web App for Containers + MySQLでコンテナ対応したPHPアプリを作ろう!
by
Yoichi Kawasaki
PPTX
Moot2013 moca ver0.3
by
科 黄
PPTX
Windows azureって何
by
Kana SUZUKI
KEY
平均レスポンスタイム50msをPerlで捌く中規模サービスの実装/運用
by
Tatsuro Hisamori
PDF
第29回長岡開発者勉強会
by
Masaki Takeda
Windows Azure PHP Tips
by
Microsoft Openness Japan
OSS on Azure で構築するウェブアプリケーション
by
Daisuke Masubuchi
PHP on Windows Azure
by
Microsoft
PHP on Windows Azure
by
Microsoft Openness Japan
PHP on Windows Azure in Open Source Conference
by
Microsoft
第3回岡山PHP勉強会
by
Masaki Takeda
Using Windows Azure
by
Shinji Tanaka
Windows Azure for PHP Developers
by
fumios
クラウド時代の Web サイト構築 ~ Windows Azure Web サイト概要 ~
by
Akira Inoue
Microsoft azure上にwebサイトやアプリケーションを構築する方法 アドバンスド
by
Kazumi Hirose
20120731 c4 saリリースパーティlt
by
Kaz Watanabe
AzureでLaravel動かしてみた
by
Keiji Kamebuchi
PHP on Windows Azure Training
by
Microsoft Openness Japan
Web appsとcleardbで作る簡単webサイト
by
Tsukasa Kato
PHP 開発環境構築- Windows 編 -
by
Masaki Takeda
Web App for Containers + MySQLでコンテナ対応したPHPアプリを作ろう!
by
Yoichi Kawasaki
Moot2013 moca ver0.3
by
科 黄
Windows azureって何
by
Kana SUZUKI
平均レスポンスタイム50msをPerlで捌く中規模サービスの実装/運用
by
Tatsuro Hisamori
第29回長岡開発者勉強会
by
Masaki Takeda
More from Masashi Shinbara
PDF
日本語消えたスライド
by
Masashi Shinbara
PDF
Twilio入門 -Web アプリ編-
by
Masashi Shinbara
PDF
いまどきのPHP開発現場 -2015年秋-
by
Masashi Shinbara
PDF
先取り!PHP 7 と WordPress
by
Masashi Shinbara
PDF
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
by
Masashi Shinbara
PDF
How to learn Laravel5 application from Authentication
by
Masashi Shinbara
PDF
ビルドサーバで使うDocker
by
Masashi Shinbara
PDF
Ansible ではじめるサーバ作業の自動化
by
Masashi Shinbara
PDF
VagrantユーザのためのDocker入門
by
Masashi Shinbara
PDF
キャラ立ちしたエンジニアになる!
by
Masashi Shinbara
PDF
Composer 再入門
by
Masashi Shinbara
PDF
もう XAMPP / MAMP はいらない! Vagrant で作る PHP 開発環境
by
Masashi Shinbara
PDF
Vagrant を Web開発環境に使う
by
Masashi Shinbara
PDF
PHP 5.5 Zend OPcache
by
Masashi Shinbara
PDF
サーバの防災訓練
by
Masashi Shinbara
PDF
Kansai PHP Users Group 2012年活動報告
by
Masashi Shinbara
KEY
10分で分かる最近のCakePHP
by
Masashi Shinbara
日本語消えたスライド
by
Masashi Shinbara
Twilio入門 -Web アプリ編-
by
Masashi Shinbara
いまどきのPHP開発現場 -2015年秋-
by
Masashi Shinbara
先取り!PHP 7 と WordPress
by
Masashi Shinbara
Twilio を使えば簡単にできる アプリケーションと電話/SMS連携
by
Masashi Shinbara
How to learn Laravel5 application from Authentication
by
Masashi Shinbara
ビルドサーバで使うDocker
by
Masashi Shinbara
Ansible ではじめるサーバ作業の自動化
by
Masashi Shinbara
VagrantユーザのためのDocker入門
by
Masashi Shinbara
キャラ立ちしたエンジニアになる!
by
Masashi Shinbara
Composer 再入門
by
Masashi Shinbara
もう XAMPP / MAMP はいらない! Vagrant で作る PHP 開発環境
by
Masashi Shinbara
Vagrant を Web開発環境に使う
by
Masashi Shinbara
PHP 5.5 Zend OPcache
by
Masashi Shinbara
サーバの防災訓練
by
Masashi Shinbara
Kansai PHP Users Group 2012年活動報告
by
Masashi Shinbara
10分で分かる最近のCakePHP
by
Masashi Shinbara
Azure Websites で作るスケーラブルな PHP アプリケーション
1.
2015/01/16 shin1x1 GoAzure 2015 Azure Websites
で作る スケーラブルな PHPアプリケーション
2.
2015/01/16 shin1x1 GoAzure 2015 LAMP(LAPP)ユーザが使う Azure Websites
3.
Agenda (c) 2015 Masashi
Shinbara @shin1x1 • Azure Websites とは • Azure Websites の PHP環境 • スケーラブルな PHP アプリケーション • まとめ
4.
(c) 2015 Masashi
Shinbara @shin1x1 Azure Websites
5.
Azure Websites (c) 2015
Masashi Shinbara @shin1x1 • Azure の PaaS (Platform as a Service) • デプロイするだけで、すぐに公開できる • 柔軟なスケール / オートスケール • .NET、Java、PHP、Node.js、Python
6.
詳しくは (c) 2015 Masashi
Shinbara @shin1x1 http://azure.microsoft.com/ja-jp/services/websites/
7.
おさえておく特徴 (c) 2015 Masashi
Shinbara @shin1x1 • 東日本 / 西日本リージョン • 多様なデプロイ方法( Git あり) • コマンドラインツール( azure コマンド) • Windows Server + IIS • DB や KVS 等は、別サービスと連携
8.
Webインスタンスを作って、デプロイする $ git init $
echo “<?php phpinfo();” > index.php $ git add . $ git commit -m ‘init’ $ azure $ azure site create shin1x1-goazure --location "Japan East" $ git push azure master $ open http://shin1x1-goazure.azurewebsites.net
9.
PHPバージョン変更 $ azure site
set --php-version 5.5
10.
$ azure portal 管理サイト(ポータル)を開く
11.
Monaco でシェル操作
12.
操作ツール (c) 2015 Masashi
Shinbara @shin1x1 • 現ポータルサイト • 新ポータルサイト • コマンドラインツール • Visual Studio Online Monaco • Kudu
13.
(c) 2015 Masashi
Shinbara @shin1x1 PHP環境
14.
PHP (c) 2015 Masashi
Shinbara @shin1x1 • Windows 版 PHP • 32bit / 64bit • 5.3 / 5.4 / 5.5 / 5.6 • ランタイムを追加することも可能
15.
PHPランタイムの追加 (c) 2015 Masashi
Shinbara @shin1x1 http://azure.microsoft.com/ja-jp/documentation/articles/ web-sites-php-configure/#UseCustomPHP
16.
PHP拡張 (c) 2015 Masashi
Shinbara @shin1x1 • 主要なものは有効 (mbstring / pdo / opcache 等) • DLL を追加して、利用可能
17.
PHP拡張の追加 (c) 2015 Masashi
Shinbara @shin1x1 http://azure.microsoft.com/ja-jp/documentation/articles/ web-sites-php-configure/#EnableExtDefaultPHP
18.
Composer (c) 2015 Masashi
Shinbara @shin1x1 • デフォルトでは、未対応 • Websites 上で直接実行する (Monaco / Kudo) • デプロイスクリプトを利用すれば、 デプロイ時に composer install
19.
デプロイスクリプトのひな形を生成 $ azure site
deploymentscript --php -t bash # .deployment deploy.sh が生成される
20.
deploy.sh を編集 $ vim
deploy.sh # 下記を DEPLOYMENT セクション上に追加 curl -sS https://getcomposer.org/installer | php php composer.phar install --prefer-dist --no-dev
21.
デプロイ時に composer install
実行 $ git push azure master (snip) remote: Loading composer repositories with package information remote: Installing dependencies from lock file remote: - Installing shin1x1/sample (dev-master 565c62e) remote: Downloading: connection... Downloading: 100% remote: Extracting archive remote: (snip)
22.
.htaccess (c) 2015 Masashi
Shinbara @shin1x1 • IIS なので、.htaccess は対応しない • 設定を Web.Config に記述 • .htaccess -> Web.Config 変換サイト http://cbsa.com.br/tools/online-convert-htaccess-to-web-config.aspx
23.
Azure SDK for
PHP (c) 2015 Masashi Shinbara @shin1x1 • Azure サービスを PHP から操作 • Composer / PEAR でインストール • 開発が、ややのんびり?
24.
(c) 2015 Masashi
Shinbara @shin1x1 スケーラブルな PHPアプリケーション
25.
The Twelve-Factor App (c)
2015 Masashi Shinbara @shin1x1 • アプリケーションは、プロセスとして実行 • プロセスは、ステートレスで、共有しない • データは、バックエンドサービスに保存すべき • Sticky session には依存しない http://12factor.net/processes
26.
サンプルアプリケーション (c) 2015 Masashi
Shinbara @shin1x1 • 会員制画像投稿サイト • Laravel 4.2 • ログイン / 画像登録 / 画像閲覧 会員制画像投稿サイト Laravel 4.2 ログイン 画像登録 / 画像閲覧
27.
アプリケーションデータ (c) 2015 Masashi
Shinbara @shin1x1 • ユーザデータ = ClearDB(MySQL)Free • セッション = Webインスタンス(ファイル) • 画像 = Webインスタンス(ファイル)
28.
構成 (c) 2015 Masashi
Shinbara @shin1x1 セッション ClearDB 写真 ユーザデータ
29.
インスタンス2台構成 (c) 2015 Masashi
Shinbara @shin1x1 セッション ClearDB 写真 セッション 写真 ユーザデータ
30.
インスタンス2台構成 (c) 2015 Masashi
Shinbara @shin1x1 ClearDB ログイン
31.
インスタンス2台構成 (c) 2015 Masashi
Shinbara @shin1x1 ClearDB セッション
32.
インスタンス2台構成 (c) 2015 Masashi
Shinbara @shin1x1 ClearDB セッション 会員ページ
33.
インスタンス2台構成 (c) 2015 Masashi
Shinbara @shin1x1 ClearDB セッション セッションが無い!
34.
インスタンス2台構成 (c) 2015 Masashi
Shinbara @shin1x1 ClearDB セッション ログアウト
35.
検証 (c) 2015 Masashi
Shinbara @shin1x1 • 2インスタンス構成 • ログインして、会員ページを何度もリロード • ログアウトするはず
36.
ログアウトしない!
37.
Sticky Session (c) 2015
Masashi Shinbara @shin1x1 • デフォルトで、LB の Sticky Sessionが有効 • リロードだと、常に同じインスタンスへアクセス • Arr-Disable-Session-Affinity ヘッダで 無効にできる http://blogs.msdn.com/b/windowsazurej/archive/2013/11/25/blog- disabling-arrs-instance-affinity-in-windows-azure-web-sites.aspx
38.
検証2 (c) 2015 Masashi
Shinbara @shin1x1 • WebサイトにインスタンスIDを表示 • Sticky Session はオフに • インスタンスID が変化することは確認済
39.
ログアウトしない!!
40.
なぜか???
41.
インスタンス2台構成 (c) 2015 Masashi
Shinbara @shin1x1 セッション 写真 セッション 写真
42.
おそらく… (c) 2015 Masashi
Shinbara @shin1x1 セッション 写真
43.
(c) 2015 Masashi
Shinbara @shin1x1 セッション 写真 Azure Storage ?? おそらく…
44.
インスタンスのストレージ? (c) 2015 Masashi
Shinbara @shin1x1 C: 共有されていない D: 共有されている?
45.
(c) 2015 Masashi
Shinbara @shin1x1 C: D: デプロイしたアプリケーション D:homesitewwwroot インスタンスのストレージ?
46.
(c) 2015 Masashi
Shinbara @shin1x1 C: D: Laravel でのセッション D:homesitewwwroot appstoragesessions インスタンスのストレージ?
47.
(c) 2015 Masashi
Shinbara @shin1x1 C: D: PHPデフォルトのセッション C:DWASFilesSitesxxxxTemp インスタンスのストレージ?
48.
DEMO2
49.
スケーラブルにするには (c) 2015 Masashi
Shinbara @shin1x1 データが D: にあれば 何もしなくて良い
50.
スケーラブルにするには (c) 2015 Masashi
Shinbara @shin1x1 データが C: にあれば 別サービスに逃す (セッションなら sticky session でも可)
51.
デフォルト構成のまま で良いか?
52.
負荷を計測 (c) 2015 Masashi
Shinbara @shin1x1 • jmeter で計測(大阪) • 画像表示ページ (DB = Read / セッション = Read / Write) • 1インスタンス(Basic / S / Japan East)
53.
ケース1 (c) 2015 Masashi
Shinbara @shin1x1 ClearDB • データベース = ClearDB (Free) • Thread = 10 / Rumpup = 60 / Loop = 10 • Response time = 1,217ms
54.
ケース2 (c) 2015 Masashi
Shinbara @shin1x1 CentOS MySQL • データベース = Azure VM (Basic_A0) • Thread = 10 / Rumpup = 60 / Loop = 10 • Response time = 188ms
55.
1クエリの速度 (c) 2015 Masashi
Shinbara @shin1x1 Azure VM(MySQL) = 2ms ∼ 20ms ClearDB(Free)= 3ms ∼ 200ms
56.
ケース3 (c) 2015 Masashi
Shinbara @shin1x1 CentOS MySQL • セッション = ファイル(共有ディスク?) • Thread = 60 / Rumpup = 60 / Loop = 10 • Response time = 3,892ms
57.
ケース4 (c) 2015 Masashi
Shinbara @shin1x1 CentOS MySQL • セッション = Azure Redis Cache • Thread = 60 / Rumpup = 60 / Loop = 10 • Response time = 223ms
58.
(c) 2015 Masashi
Shinbara @shin1x1 スループット req/sec 0 10 20 30 40 ケース1 ケース2 ケース3 ケース4
59.
(c) 2015 Masashi
Shinbara @shin1x1 • とりあえずは、そのままで良い (Sticky session / 共有ディスク) • 負荷に応じて、アプリケーションデータを 別サービスに逃がしていく • Azure サービスなら、利用しやすい スケーラブルにするには
60.
(c) 2015 Masashi
Shinbara @shin1x1 CDNによるコンテンツ配信 • Azure CDN • Azure Websites をオリジンサーバに • エッジロケーションから高速配信
61.
(c) 2015 Masashi
Shinbara @shin1x1 まとめ
62.
(c) 2015 Masashi
Shinbara @shin1x1 • 日本国内にある PHP の PaaS • 無料枠で、簡単に試せる • 元からスケーラブルな構成 • Azure サービスとの親和性が高い • Windows ユーザだけに使わせるのは勿体無い まとめ
63.
@shin1x1 (c) 2015 Masashi
Shinbara @shin1x1
Download