What is App Engine FE?
- App Engineのコンテナを、Dockerベースのものに差し替え、Compute Engineの上で動かす機能
- 旧 Managed VMs (Managed VMs誕生までの歴史を振り返る)
App Engine Architecture

App Engine Standard Environment
- 限定されたコンテナ
- runtime 縛り (Java, Python, Go, PHP)
- CPUはシングルコアのみ
- メモリの最大は1GB
App Engine Standard Environment
- ミドルウェア利用不可
- local file systemに書き込み不可
- 好きなportをlistenできない
App Engine Flexible Environment
- Compute Engine上にコンテナを立てる
- Dockerコンテナ
- 自由な世界
- App EngineのAPIをそのまま使える
- ミドルウェアインストール可能
App Engine FE Architecture

FEで用意済みのRuntime
- Go
- Java 8 / Servlet 3.1 / Jetty 9
- Python 2.7 and Python 3.4
- Node.js
- Ruby
Demo
Custom Runtime
- 好きなDockerfileを書いて動かす
App Engine FEの使いどころ
- WebSocket (ただし、めんどう。。。)
- マルチコアCPU, 豊富なメモリ
- ImageMagickなどミドルウェアが必要な時
- standard runtime以外が使いたい時
FEでClientからのリクエストを受け取る
WebSocketはなぜめんどうか?
- App Engine FrontendはWetSocketが使えない
- FEが動いているGCEのグローバルIPAddrに接続する必要がある

FEは好きなportをlistenできる?
- Yes
- しかし、やっぱり、App Engine Frontendは通れない

SEでできないことをFEに頼る
SEでできないことをFEに頼る
- ユーザからのリクエストはSEで受け、後ろのバッチはFEで回す
- Example : サムネイル作成 ...

FEで失われた物
- spinup speed - SE:10ms ~ 7000ms, FE:1min
- price - SE:豊富な無料枠, FE:Compute Engineの料金に準拠
FEの不便なところ
- Preemptible VMが使えない
- 1VM 1コンテナ
- 最低インスタンス台数 = 1
Preemptible VMを使ったバッチ処理
- TaskはQueueで管理し、Preemptible Instanceがshutdonwされても、別のWokerでTaskをリトライする
- Taskの数に応じてWorkerの数を調整

Preemptible VMを使う利点
安い
僕が欲しかったFE
- 1 VM マルチコンテナ
- 負荷に応じて、コンテナをスケールさせる
