【问题标题】:Appengine deployments are extraodinarily slow today?App Engine 部署今天异常缓慢?
【发布时间】:2016-06-06 13:53:36
【问题描述】:

我们有一个小型java项目需要部署 它包括 9000 多个文件

命令:mvn gcloud:deploy

但我得到了日志:

    ...
[INFO] INFO: Uploading [/home/steven/work/idigisign/target/appengine-staging/__static__/node_modules/rx/src/core/linq/observable/when.js] to [7dfb30ad32893c5042dba03601f006a40419fab0]
    [INFO] DEBUG: Uploading [/home/steven/work/idigisign/target/appengine-staging/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js] to [7e0725897d7b99c3c33b56915d202e2dde552ea9]
    [INFO] INFO: Uploading [/home/steven/work/idigisign/target/appengine-staging/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js] to [7e0725897d7b99c3c33b56915d202e2dde552ea9]
    [INFO] DEBUG: Uploading [/home/steven/work/idigisign/target/appengine-staging/node_modules/is-redirect/index.js] to [7e0afe4775bf7f8558665760171c01948c22f771]
    [INFO] INFO: Uploading [/home/steven/work/idigisign/target/appengine-staging/node_modules/is-redirect/index.js] to [7e0afe4775bf7f8558665760171c01948c22f771]
    [INFO] DEBUG: Uploading [/home/steven/work/idigisign/target/appengine-staging/node_modules/rxjs/src/util/Map.ts] to [7e11722f4cd9ce91ec99b97710fbc4e7f40be09d]
...

每分钟大约 50 个 所以它将花费 180 分钟...

非常慢

有人可以帮助我吗?

【问题讨论】:

  • 帮助您...加速 Appengine?坦率地说,我对此表示怀疑。
  • 我不知道为什么部署很慢,以前很快。也许我的项目中有错误配置?
  • 也许吧,但是谁知道你写过什么?

标签: google-app-engine gcloud google-managed-vm managed-vm


【解决方案1】:

设置环境变量CLOUDSDK_APP_USE_GSUTIL=1再试一次;这将使用不太可靠但更快的代码路径进行文件上传(有计划加快默认代码路径)。

【讨论】:

    【解决方案2】:

    我们有同样的问题,它很慢。 猜猜我们已经解决了。

    首先,我们追踪了gcloud的日志,我们发现很多文件又被上传了,这些文件都没有被修改过。于是我们尝试追踪gcloud的源代码,发现问题是由“Google Cloud Storage JSON API”引起的。

    当它查询存储桶列表时,它返回了 1000 个项目,但我们有 1325 个项目,所以我想我们找到了问题。

    然后,我们查找api引用,找到了一个参数——maxResults,于是尝试修改源码(cloud_storage.py),发现值超过1000时没有影响。

    最后,我们找到另一个参数——nextPageToken,我们查询列表直到“nextPageToken”为No​​ne,现在它从“Google Cloud Storage”中获取了所有项目,并且不再上传存在的文件。

    def ListBucket(bucket_ref, client):
      request = STORAGE_MESSAGES.StorageObjectsListRequest(bucket=bucket_ref.bucket)
    
      items = set()
      try:
        response = client.objects.List(request)
        for item in response.items:
          items.add(item.name)
        while response.nextPageToken:
          request = STORAGE_MESSAGES.StorageObjectsListRequest(bucket=bucket_ref.bucket,pageToken=response.nextPageToken)
          response = client.objects.List(request)
          for item in response.items:
            items.add(item.name)
      except api_exceptions.HttpError as e:
        raise UploadError('Error uploading files: {e}'.format(e=e))
    
      return items
    

    【讨论】:

    • 此问题已在(即将发布的)Cloud SDK 115.0.0 中修复。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-20
    • 2015-12-19
    • 2015-02-19
    • 2013-10-23
    相关资源
    最近更新 更多