How do dynamic backends start in Google App Engine

2019-03-13 06:51发布

Can we start a dynamic backend programatically? mean while when a backend is starting how can i handle the request by falling back on the application(i mean app.appspot.com).

When i stop a backend manually in admin console, and send a request to it, its not starting "dynamically"

3条回答
The star\"
2楼-- · 2019-03-13 07:18

It appears that a dynamic backend need not be explicitly stopped. The overvicew (http://code.google.com/appengine/docs/python/backends/overview.html) states that the billing for a dynamic backend stops 15 minutes after the last request is processed. So, if your app has a cron job, for example, that requires 5 minutes to complete, and needs to run every hour, then you could configure a backend to do this. The cost you'll incur is 15+5 minutes every hour, or 8 hours for the whole day. I suppose the free quota allows you 9 backend hours. So, this type of scenario would be free for you. The backend will start when you send your first request to it through a queue, and will stop 15 minutes after the last request you send is processed completely.

查看更多
Luminary・发光体
3楼-- · 2019-03-13 07:23

Dynamic backends come into existence when they receive a request, and are turned down when idle; they are ideal for work that is intermittent or driven by user activity.

Resident backends run continuously, allowing you to rely on the state of their memory over time and perform complex initialization.

http://code.google.com/appengine/docs/python/backends/overview.html

I recently started executing a long running task on a dynamic backend and noticed a dramatic increase in the performance of the frontends. I assume this was because the long running task was competing for resources with normal user requests.

查看更多
来,给爷笑一个
4楼-- · 2019-03-13 07:26

Backends are documented quite thoroughly here. Backends have to be started and stopped with appcfg or the admin console, as documented here. A stopped backend will not handle requests - if you want this, you should probably be using the Task Queue instead.

查看更多
登录 后发表回答