1

I develop an appengine application right now in python and I am surprised by the instance hours quotas I get, while I try to optimize my app for costs and performance.

I am testing right now one specific task_queue. (nothing else is running during that - before I start no instance is up)

the queue is configured with a rate/s of 100 with 100 buckets. no configured limit for max_concurrent_requests

900 tasks will get pushed in this queue. 10-11 instances pop-up in this moment to deal with it.

everything takes far less than 30 seconds and every task is executed.

I check my instance hours quotas before and after that and I consume about 0.25 - 0.40 instance hours.

why is that?

shouldn't it be much less? is there an inital cost or a minimum amount which will be charged if one instance opens?

4

2 回答 2

1

打开实例后,您至少需要 15 分钟。您的 10-11 个实例总共应该花费您大约 2.5 小时。
如果您不需要如此快速的处理,您应该使用 max_concurrent_requests 限制队列的并行处理量。

于 2013-01-26T16:37:57.753 回答
1

我很确定当高速队列上有任务积压时,调度程序会增加实例数。100/100 是一个非常高的比率。您正在告诉调度程序非常快地执行这些操作,这意味着它会启动实例来执行此操作。

除非您需要非常快速地处理这些任务,否则您应该使用低得多的速率。这将导致更少的实例和更长的任务队列。根据您的处理要求,您也许可以使用拉取队列。这样做可以让你一次租用和处理数百个任务,并利用批处理 put() 等。这真的取决于你在做什么。

于 2013-01-26T20:41:04.390 回答