Reputation: 98
I currently use app engine standard environment with django. I want to have automatic scaling and always have at least one instance running.
Consulting the documentation it says that to use min_instances
it is recommended to have warm up requests
enabled.
My question is: is this mandatory? Is there no way to always have an active instance without using warm up requests
?
Upvotes: 1
Views: 877
Reputation: 11360
This is probably more of a question for Google engineers. But, I think that they are required. The docs don't say "recommended"; They say "must":
Imagine if your instances shut down because of a server reboot. The warmup
request gets them running again. A start
request would also do the trick, but after some delay. It could be that Google depends on sending warmup
requests after reboot, and not start
.
UPDATE
You just need a simple url handler that returns a 200 response. Could be something as simple as this in your app.yaml
:
- url: /_ah/warmup # just serve simple, quick
static_files: static/img/favicon.ico
upload: static/img/favicon.ico
Or better, in your urls.py
, point the url handler to a view like this:
(r'^_ah/warmup$', 'warmup'),
in views.py:
from django.http import HttpResponse
def warmup():
return HttpResponse('hello', content_type='text/plain')
Upvotes: 3