Google App Engine 中的动态后端如何启动

发布于 2024-11-14 05:34:47 字数 116 浏览 3 评论 0原文

我们可以以编程方式启动动态后端吗?同时,当后端启动时,我如何通过回退到应用程序(我的意思是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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

虫児飞 2024-11-21 05:34:47

动态后端在收到请求时就会出现,并且
空闲时调低;他们非常适合以下工作
间歇性或由用户活动驱动。

常驻后端持续运行,让您可以依赖状态
随着时间的推移,它们的内存并执行复杂的初始化。

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

我最近开始在动态后端上执行一个长时间运行的任务,并注意到前端性能的显着提高。我认为这是因为长时间运行的任务正在与正常用户请求竞争资源。

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.

凉城已无爱 2024-11-21 05:34:47

此处对后端进行了非常详尽的记录。必须使用 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.

风为裳 2024-11-21 05:34:47

看来动态后端不需要显式停止。概述 (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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文