I have enabled Warming Requests to my app, adding the following directive in app.yaml.
inbound_services:
- warmup
Looking at app’s log I see several entries of this kind:
1.
01-05 02:49PM 50.037 /_ah/warmup 404 300ms 280cpu_ms 1kb
See details0.1.0.3 - - [05/Jan/2011:05:49:50 -0800] "GET /_ah/warmup HTTP/1.1" 404 11882.
I 01-05 02:49PM 50.336This request caused a new process
to be started for your application,
and thus caused your application code
to be loaded for the first time.
This request may thus take longerand
use more CPU than a typical request
for your application.
This makes sense because the Warming Requests documentation says:
This causes the App Engine
infrastructure to issue GET requests
to /_ah/warmup. You can implement
handlers in this directory to perform
application-specific tasks, such as
pre-caching application data.
AFAIK ah is a reserved URL, i.e. script handler and static file handler paths will never match these paths!
Should I simply add the ah/warmup route associating it to an empty web handler for example? Is this correct?
Urls starting with
/_ah/work just fine, despite what the documentation might lead you to believe.So, yes, just map a handler to
/_ah/warmupto make the warmup requests work. I’m not sure how much benefit you’ll get from using an empty handler, though. Usually you’d want to import all of your important modules and do any cache warmups your app needs to be responsive.