Todd Page
Todd Page

Reputation: 173

How does the warmup service work in python google app engine?

Can someone give an example of how the warmup inbound service works in the python runtime of Google App Engine?

I've read this: http://code.google.com/appengine/docs/python/config/appconfig.html#Inbound_Services, but it doesn't give me much of an example after the GET request is sent (I can't seem to ever pick it up)

My app.yaml looks like this:

application: whatevs
version: 1
runtime: python
api_version: 1

builtins:
- datastore_admin: on

inbound_services:
- warmup

handlers:
- url: /static
  static_dir: static

- url: /_ah/warmup
  script: main.py
  login: admin 

- url: /.*
  script: main.py

my main.py looks like this:

def main():
    application = webapp.WSGIApplication(
                     [("/", views.LandingPage),
                      ("/_ah/warmup", views.WarmupHandler)
                      ],
                     debug=True)
    run_wsgi_app(application)

WarmupHandler looks like this:

class WarmupHandler(webapp.RequestHandler):
    """
    Called on app init
    """
    def get(self):
        current_user = users.get_current_user()
        return

However, WarmupHandler never seems to get called (I have breakpoints and lots of debug code). What am I doing wrong?

Upvotes: 3

Views: 3200

Answers (1)

Teemu Ikonen
Teemu Ikonen

Reputation: 11929

App Engine sends warm up requests only if there is some constant traffic on your app. It won't get always called if instances stand mostly idle.

Upvotes: 1

Related Questions