Google App Engine 中的动态后端如何启动
我们可以以编程方式启动动态后端吗?同时,当后端启动时,我如何通过回退到应用程序(我的意思是app.appspot.com)来处理请求。
当我在管理控制台中手动停止后端并向其发送请求时,它不会“动态”启动
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"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://code.google.com/appengine/docs/python/backends /overview.html
我最近开始在动态后端上执行一个长时间运行的任务,并注意到前端性能的显着提高。我认为这是因为长时间运行的任务正在与正常用户请求竞争资源。
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.
此处对后端进行了非常详尽的记录。必须使用 appcfg 或管理控制台启动和停止后端,如文档所述 这里。停止的后端将不会处理请求 - 如果您想要这样,您可能应该使用任务队列。
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.
看来动态后端不需要显式停止。概述 (http://code.google.com/appengine/docs/python/backends/overview.html) 指出,动态后端的计费将在处理最后一个请求后 15 分钟停止。因此,如果您的应用程序有一个 cron 作业,例如,需要 5 分钟才能完成,并且需要每小时运行一次,那么您可以配置一个后端来执行此操作。您将产生的费用为每小时 15+5 分钟,或全天 8 小时。我想免费配额可以让你使用 9 个小时的后端时间。所以,这种类型的场景对你来说是免费的。当您通过队列向后端发送第一个请求时,后端将启动,并在您发送的最后一个请求完全处理后 15 分钟停止。
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.