Google App Engine optimization
- Use memcache for things that are read often (after a put(), memcache.get() before a db.Query(), and EXPIRE it)
- Use AppStats https://developers.google.com/appengine/docs/python/tools/appstats#OptionalConfiguration
ADD THE FILE:
appengine_config.py
def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
appstats_CALC_RPC_COSTS = True
app = recording.appstats_wsgi_middleware(app)
return app
APP.YAML
application: myproject
version: 3
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /css
static_dir: assets/css
- url: /js
static_dir: assets/js
- url: /images
static_dir: assets/images
- url: /.*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
- name: jinja2
version: latest
builtins:
- appstats: on
- MONITOR: http://your_app_id.appspot.com/_ah/stats (this includes localhost:8080/_ah_stats )