douduxia1551 2014-07-14 06:21
浏览 42
已采纳

为什么调用此方法会导致我的应用超出免费配额?

Having trouble understanding what is going on. The only location I call datastore.Put operations (no indexes as far as I can tell) is in the function below. It is called exactly 9 times per minute (or less if something fails).

func SaveCurrentStatus(c appengine.Context, check *StatusCheck, ok bool, latency time.Duration, message string) {
    r := Result{
        Id:      check.Id,
        Name:    check.Name,
        Ok:      ok,
        Latency: latency,
        Message: message,
    }
    uid := datastore.NewKey(c, "Status", "", check.Id, nil)
    _, err := datastore.Put(c, uid, &r)
    if err != nil {
        c.Errorf("%s", err.Error())
        return
    }

    MemcachePut(c, fmt.Sprintf("Status-%d", check.Id), r)
}

It is my understanding that this should result in 9*60*24 write operations (they are not new entities). This is a total of 19,960 operations per day, the free quota is supposed to be 0.05 million?

Are there any utilities that might help me analyse what is going on or see some sort of log of what is going on that I don't know about?

  • 写回答

1条回答 默认 最新

  • dongxixian7803 2014-07-14 07:47
    关注

    I do not have much experience with Go but I would say that you must explicitly set your properties to be unindexed otherwise they are indexed by default. Then each entity write also includes writes to every index (both ascendent and descendent) associated with the entity's properties.

    You can find more details here.

    In Google Developers Console you can check which properties of a given entity use index.

    Go to the Storage / Cloud Datastore / Dashboard and as a kind select entity of your choice. It displays all properties along with their index size.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?