john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

google app engine cost and performance optimization

Google App Engine optimization

  1. Use memcache for things that are read often (after a put(), memcache.get() before a db.Query(), and EXPIRE it)
  2. 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
  1. MONITOR: http://your_app_id.appspot.com/_ah/stats (this includes localhost:8080/_ah_stats )

  • « memcache intro
  • server echo »

Published

May 11, 2013

Category

python-appengine

~91 words

Tags

  • appengine 18
  • cost 1
  • engine 12
  • google 18
  • optimization 4
  • performance 6
  • python 180