本文介绍了GAE:队列,配额和后端实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有很多任务的队列。我想用一个后端实例来处理这个队列。我的配额信息告诉我,我在数百个前端实例小时中已经完成预算,并且没有使用任何后端实例小时。由于我只配置了一个后端实例,因此我期望每小时收费不超过1(后端)实例小时。这是我的配置:

backends.yaml

 后端:
- name:worker
class:B8
instances:1
options:dynamic

queue.yaml

   -  name:import 
rate:20 / s
bucket_size:40

将任务添加到我的脚本中排队

  deferred.defer(importFunction,_target ='worker',_queue =import)

账单状态

 资源使用情况
前端实例小时数198.70实例小时数
后端实例小时数0.00实例小时数

任务标题

  X-AppEngine-Current-Namespace 
Content-Type应用程序/八位字节流
Referer http://worker.appname.appspot.com/ _ah / queue / deferred
Content-Length 1619
Host worker.appname.appspot.com
User-Agent AppEngine上,谷歌; (+ http://code.google.com/appengine)


解决方案

我需要部署我的后端代码:

  appcfg.py后端更新目录实例名称


I have a queue with a lot of tasks in it. I would like to use one backend instance to process this queue. My quota info tells me I have blown my budget on hundreds of frontend instance hours and have not used any backend instance hours. As I had configured only one backend instance, I was expecting to be charged no more than 1 (backend) instance hour per hour. Here is my configuration:

backends.yaml

backends:
- name: worker
  class: B8
  instances: 1
  options:dynamic

queue.yaml

- name: import
  rate: 20/s
  bucket_size: 40

adding tasks to queue in my script

deferred.defer(importFunction, _target='worker', _queue="import")

bill status

Resource                     Usage
Frontend Instance Hours      198.70 Instance Hours
Backend Instance Hours       0.00 Instance Hours

Task Headers

X-AppEngine-Current-Namespace
Content-Type    application/octet-stream
Referer http://worker.appname.appspot.com/_ah/queue/deferred
Content-Length  1619
Host    worker.appname.appspot.com
User-Agent  AppEngine-Google; (+http://code.google.com/appengine)
解决方案

I needed to deploy my backend code:

appcfg.py backends update dir instance_name

这篇关于GAE:队列,配额和后端实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 08:41