Our applicationArchitecture
• Multiplatform design
https://github.com/hayorov/example-voting-app
• Dockerized
• Hosted in Docker VM
Our applicationVoting-app
GET /
voting-appPOST /vote: a
rpushvoter_id, vote
•Flask (python 2.7-alpine)•Gunicorn•Redis (TCP)
New project on cloud.google.com
Install Google Cloud Platform SDK (gcloud)
runtime: python27api_version: 1threadsafe: true
handlers:- url: /
script: app.app
- url: /staticstatic_dir: static
Create app.yaml file
⇒ gcloud app deploy --project catsdogsvoteYou are about to deploy the following services:- catsdogsvote/default/20161120t203231 (from [example-voting-app/vote/app.yaml])
Deploying to URL: [https://catsdogsvote.appspot.com]
Beginning deployment of service [default]...File upload done.Updating service [default]...done.Deployed service [default] to [https://catsdogsvote.appspot.com]
goto https://catsdogsvote.appspot.com
Collecting Flask (from -r requirements.txt (line 1))Using cached Flask-0.11.1.tar.gz…Running setup.py install for Flask ... doneRunning setup.py install for Redis ... doneRunning setup.py install for gunicorn ... done
Successfully installed Flask Jinja2-2.8 MarkupSafe-0.23 Redis Werkzeug click gunicorn itsdangerous-0.24
⇒ virtualenv ./env && pip install -r requirements.txt #fixme
Create appengine_config.py
from google.appengine.ext import vendor
vendor.add('env/lib/python2.7/site-packages')
⇒ gcloud app deploy --project catsdogsvote
rps-instances/time
t, secs
rps1k
100
Count: 321612Load: line(1, 1000, 10m) const(100, 5m)
HTTP codesCount Percent200 - OK 65.2% (430490)500 - Error 32.2% (212734)??? - Error 2.6% (17306)
workload300 600
created instances
183
Response time distributiontime, s quantile12000 1005000 871000 71500 63350 41150 4
Top Related