0

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?

Nato
  • 88
  • 8

1 Answers1

2

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":

enter image description here

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')
GAEfan
  • 11,244
  • 2
  • 17
  • 33
  • I would like to config app engine with warmup, but at the moment I haven't found a tutorial with Django, that's why I want to have one instance always running in an easy way. – Nato Jul 30 '20 at 22:21
  • See update. You just need a call to `/_ah/warmup` to return a 200 response. – GAEfan Jul 30 '20 at 23:24