Submit Search
Upload
ロリポップ!マネージドクラウド FastContainerの裏側
•
Download as PPTX, PDF
•
3 likes
•
2,102 views
諒
諒介 田中
Follow
GMO HosCon 10で発表した資料です
Read less
Read more
Internet
Report
Share
Report
Share
1 of 51
Download now
Recommended
パブリッククラウドConoHaを使ってOpenStack APIを理解する
パブリッククラウドConoHaを使ってOpenStack APIを理解する
Hironobu Saitoh
Hueによる分析業務の改善事例
Hueによる分析業務の改善事例
Masahiro Kiura
Python charity talk in japan fastAPI introduction
Python charity talk in japan fastAPI introduction
ssuserc75dc7
5分で詰め込む フロントエンド最適化
5分で詰め込む フロントエンド最適化
Shohei Tai
ServiceWorkerでつくるWebの未来
ServiceWorkerでつくるWebの未来
Yoshiki Kobayashi
AWSでGPUも安く大量に使い倒せ
AWSでGPUも安く大量に使い倒せ
Yasuhiro Matsuo
ReactNative はじめの一歩
ReactNative はじめの一歩
Ikki Takahashi
デブサミ2014【13-E-3】クラウド時代の環境構築・デプロイ自動化戦略
デブサミ2014【13-E-3】クラウド時代の環境構築・デプロイ自動化戦略
Developers Summit
Recommended
パブリッククラウドConoHaを使ってOpenStack APIを理解する
パブリッククラウドConoHaを使ってOpenStack APIを理解する
Hironobu Saitoh
Hueによる分析業務の改善事例
Hueによる分析業務の改善事例
Masahiro Kiura
Python charity talk in japan fastAPI introduction
Python charity talk in japan fastAPI introduction
ssuserc75dc7
5分で詰め込む フロントエンド最適化
5分で詰め込む フロントエンド最適化
Shohei Tai
ServiceWorkerでつくるWebの未来
ServiceWorkerでつくるWebの未来
Yoshiki Kobayashi
AWSでGPUも安く大量に使い倒せ
AWSでGPUも安く大量に使い倒せ
Yasuhiro Matsuo
ReactNative はじめの一歩
ReactNative はじめの一歩
Ikki Takahashi
デブサミ2014【13-E-3】クラウド時代の環境構築・デプロイ自動化戦略
デブサミ2014【13-E-3】クラウド時代の環境構築・デプロイ自動化戦略
Developers Summit
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
ロリポップ!マネージドクラウド FastContainerの裏側
1.
田中諒介 / GMO
Pepabo, Inc. 2017.09.07 GMO HosCon 10 ロリポップ!マネージドクラウド FastContainerの裏側
2.
エンジニ ア 田中諒介 @ry_023 ホスティング事業部インフラチー ム 2016年3月 熊本大学大学院情報電気電子工学専攻
修了 同年4月 GMOペパボに新卒エンジニアとして入社 2017年1月からインフラチーム配属
3.
目次 • 1. ロリポップ!マネージドクラウドについて •
2. FastContainerとは? • 3. マネクラの構成を通して解説 • リクエスト制御フロー、コンテナ停止、オートスケール • 4. 統括・FastContainerの良さ ふりかえり
4.
ペパボのホスティングサービス
5.
ロリポップ!の新プラン αテスト実施中!
6.
一般的なWebホスティング • ユーザのコンテンツ・プロセスが特定のサーバに紐づく • 負荷分散の難しさ… •
急なアクセス増へのスケールの難しさ… • 他サーバへの移行の難しさ…
7.
ロリポップ!マネージドクラウド • ロリポのプランの一つだが、バックエンド・フロントエンド共に一新 • コンテナ型ホスティングサービス •
FastContainerアーキテクチャを採用 • コンテナエンジンにhaconiwa
8.
ロリポップ!マネージドクラウド オートスケールで 急なアクセスにも対応 自動で最新の セキュリティ 様々なWebアプリを すぐに開始
9.
使いたいアプリ選んで プロジェクト名入力するだけ できる! すぐにWebアプリを提供!
10.
すぐにWebアプリを提供!
11.
オートスケー ル アクセスが増えると 複数台のコンテナでアクセスを受ける オートスケールを有効に
12.
今日はロリポ!マネクラが どういうように動いているか というお話を
13.
FastContainer
14.
FastContainerとは? ざっくり概要 • FastCGIのコンテナ版といったイメージ •
CGIのプロセスを終了せずに使い回す • リクエスト契機でWebアプリのコンテナが起動 • 一度起動したコンテナはその後使い回す • 一定時間経過すると自ら停止する
15.
FastContainerの良さ • オートスケール • リクエストがないとコンテナは停止するのでリソースの節約 •
色んなコンテナを用意することで色々なアプリを提供 • 生まれ代わり続けるので常に最新 • 他ホストへのコンテナ載せ替えも簡単 • 負荷が少ないホストにコンテナを起動させるようにする等も • compute母艦の無停止メンテもできそう
16.
ロリポの構成を通して FastContainerを見ていきます
17.
マネージドクラウド全体構成
18.
compute1 CMDBCoreAPI LBClient datapool container1 compute2 nfs nfscontainer2 container1 status: enabled host: compute1 container2
status: enabled host: compute2 コンテナの情報 Webproxy 実際コンテナが起動するホスト コンテナの情報を管理→ FastContainer関連の構成 ユーザの コンテンツ (/var/www/ 配下)
19.
ngx_mruby • 弊社@matsumotory開発 nginx拡張
(mod_mrubyもあります) • Nginxの各イベントにhookしてmrubyを実行できる • ロリポ!マネージドクラウドではプロキシ時にCoreAPIに問い合わせ たり、haconiwaを実行したりするのに活用 location / { ... mruby_set $backend /var/lib/mruby/hook.rb cache; # script実行 proxy_pass http://$backend:80; }
20.
haconiwa • 弊社@udzura開発 コンテナエンジン •
mrubyのDSLで設定(hacofile)を記述可能 • コンテナのリソース制限も(cgroupによる制限) Haconiwa.define do |config| config.chroot_to Pathname.new("/var/lib/haconiwa/rootfs/php") ... config.cgroup["cpu.cfs_period_us"] = 1000000 # cpu使用率を制限(20%) config.cgroup["cpu.cfs_quota_us"] = 200000 # config.cgroup["pids.max"] = 128 # プロセス数を制限 end
21.
マネクラのコンテ ナ • haconiwaにより起動, hacofileで設定 •
コンテナ種別毎に母艦(compute)上にrootfsを用意してsymlink • container:/ → compute:/var/lib/haconiwa/rootfs/php/ • /var/www などのユーザ領域はdatapoolをmount • initプロセスにミドルウェアを指定して起動 • アプリ種別ごとにhacofileを用意することで色んなコンテナ作れる
22.
なんでもコンテ ナ • 基本は1コンテナに1プロセス • apacheコンテナ •
sshdコンテナ • postfixコンテナ?
23.
FastContainer リクエスト制御のフロー
24.
compute1 CMDBCoreAPI LBClient datapool compute2 nfs nfs container1 status: ready host: compute1 コンテナの情報 Webproxy プロジェクト開始直後 ready=待機中
25.
compute1 datapool compute2 nfs nfs コンテナの情報 プロジェクト開始直後 container1 status: booting host:
compute1 CoreAPI LBClient Webproxy CMDB プロキシ可能な コンテナ情報を取得 クライアントから リクエスト
26.
compute1 CMDBCoreAPI LBClient datapool compute2 nfs nfs container1 status: booting host: compute1 コンテナの情報 プロジェクト開始直後 クライアントから リクエスト コンテナのIP等を ヘッダに負荷しプロキシ Webproxy
27.
compute1 CMDBCoreAPI LBClient datapool compute2 nfs nfs container1 status: booting host: compute1 コンテナの情報 Webproxy プロジェクト開始直後 クライアントから リクエスト コンテナのIP等を ヘッダに負荷しプロキシ 目的のコンテナのIP:80が LISTENしてない
28.
compute1 CMDBCoreAPI LBClient datapool compute2 nfs nfs コンテナの情報 Webproxy プロジェクト開始直後 クライアントから リクエスト container1 コンテナ起動!! container1 status: enabled host: compute1 enabled=稼働中
29.
container1 status: enabled host: compute1 compute1 CMDBCoreAPI LBClient datapool compute2 nfs nfs コンテナの情報 Webproxy プロジェクト開始直後 クライアントから リクエスト container1 コンテナ起動!! enabled=稼働中
30.
compute1 CMDBCoreAPI LBClient datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 Webproxy プロジェクト開始直後 container1 2回目以降のリクエストは コンテナ起動済みなので高速
31.
コンテナの死
32.
コンテナの寿命 • コンテナにはLifetimeが設定されており、一定時間経過で自動停止 • haconiwa
のhookでコンテナのプロセスをKILL • 利用中のコンテナが停止する際はコンテナを待機中として登録し直す • 次のリクエストでまた新しいコンテナが起動する
33.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 コンテナの寿命 \寿命きた/ container1
34.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container2 status: ready host: compute1 コンテナの情報 コンテナの寿命 待機中(ready) コンテナを再登録 HALT
35.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container2 status: enabled host: compute1 コンテナの情報 コンテナの寿命 LBClient
Webproxy リクエスト契機で 新しいコンテナ起動 container2
36.
コンテナに寿命があることで… • リクエストがないコンテナは勝手に停止し、リソースを食わずエコ! • 定期的にコンテナが新しく生まれ変わる •
新しくなるタイミングでライブラリ等も更新されセキュア • コンテナを別ホストに移行したい時もCMDBをいじるだけでOK • コンテナは明示的に停止させずとも勝手に死ぬ • compute(コンテナの母艦)のメンテしたい時も簡単
37.
オートスケー ル
38.
オートスケー ル • コンテナの負荷に応じて、コンテナ数を増減 • haconiwa
がcgroupから各コンテナのcpu・i/o負荷を計測・監視 • ユーザはコンテナの予約枠を設定可能 • コンテナが何台まで起動するか、それぞれのコンテナでリソースを どれぐらい使うかなど事前に決定しておく
39.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 スケールアウト container1 container2
status: disabled host: compute1 予約枠を登録
40.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 スケールアウト container1 container2
status: disabled host: compute1 予約枠を登録 \負荷やばい/ コンテナ増やして!
41.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 スケールアウト container1 待機コンテナに 変更 container2 status:
ready host: compute1 LBClient Webproxy リクエスト契機で 新しいコンテナ起動 container2
42.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 スケールイン container1 container2 status:
ready host: compute1 container2 \さほどでもない/ コンテナ減らして!
43.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 スケールイン container1 container2 \さほどでもない/ コンテナ減らして! container2
status: disabled host: compute1 再びdisabledへ
44.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 スケールイン container1 container2 container2
status: disabled host: compute1 LBClient Webproxy container2には ルーティングされない
45.
compute1 CMDBCoreAPI datapool compute2 nfs nfs container1 status: enabled host: compute1 コンテナの情報 スケールイン container1 container2 container2
status: disabled host: compute1 LBClient Webproxy container2には ルーティングされない これは放っておけば 勝手に停止する
46.
予約枠をとるだけで オートスケール
47.
FastContainerの良さ • オートスケール • リクエストがないとコンテナは停止するのでリソースの節約 •
色んなコンテナを用意することで色々なアプリを提供 • 生まれ代わり続けるので常に最新 • 他ホストへのコンテナ載せ替えも簡単 • 負荷が少ないホストにコンテナを起動させるようにする等も • compute母艦の無停止メンテもできそう
48.
コンテナの種類も増やしていきた い
49.
アプリの調整など進捗 αで提供中! 調整中! 間もなく その他続々……?
50.
ロリポ!マネージドクラウドを よろしくお願いします!
51.
君もペパボで働かないか? 最新の採用情報をチェック→ @pb_recruit
Download now