Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 限制GCP应用程序引擎仅使用1台应用程序引擎flex core_Google App Engine_Google Cloud Platform_App Engine Flexible_Google Appengine Node - Fatal编程技术网

Google app engine 限制GCP应用程序引擎仅使用1台应用程序引擎flex core

Google app engine 限制GCP应用程序引擎仅使用1台应用程序引擎flex core,google-app-engine,google-cloud-platform,app-engine-flexible,google-appengine-node,Google App Engine,Google Cloud Platform,App Engine Flexible,Google Appengine Node,我是GCP应用程序引擎的新手——我有一个node.js应用程序运行在app engine flex上。目前谷歌每月向我收取超过3500小时的flex实例核心小时费用。他们告诉我,我正在使用多个实例,这就是为什么要花费大量的时间。但是,我已经将app.yaml文件中的实例号限制为1——但似乎它不起作用。这是我的app.yaml文件,使用gcloud app deploy部署应用程序 #Copyright 2017, Google, Inc. # Licensed under the Apache

我是GCP应用程序引擎的新手——我有一个node.js应用程序运行在app engine flex上。目前谷歌每月向我收取超过3500小时的flex实例核心小时费用。他们告诉我,我正在使用多个实例,这就是为什么要花费大量的时间。但是,我已经将app.yaml文件中的实例号限制为1——但似乎它不起作用。这是我的app.yaml文件,使用
gcloud app deploy
部署应用程序

#Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START gae_quickstart_yaml]
runtime: nodejs
env: flex

network:
  session_affinity: true

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml

manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10
# [END gae_quickstart_yaml]


为了回答这个问题,您每月3500小时的flex实例核心小时数来自部署的AppEngine flex旧版本。由于App Engine Flex在虚拟机上运行,每当您使用命令
gcloud App deploy
部署新版本时,即使没有流量,旧版本仍在运行。使用
gcloud
命令将旧版本替换为新部署:

  • gcloud应用程序部署--version=version
此外,要删除/停止版本,您可以在谷歌云控制台(App Engine>version)中执行此操作,然后检查所有要删除/停止的版本,或者通过
gcloud
命令:

  • gcloud应用程序版本删除版本
  • gcloud应用程序版本停止版本

如果联系谷歌计费部门仍然无法解释费用的来源,我相信联系谷歌云技术支持部门可能会对此给出更多解释。

您是否有其他应用程序引擎版本仍然与当前版本同时运行?附带问题:为什么要使用App Engine flex?您的要求是什么?@guillaumeblaquiere--我使用appengine flex,因为我需要node.js应用程序的socket.io支持。@JohnMichaelG-我相信我没有任何其他App Engine版本同时运行。只能运行一个版本。我只是使用
gcloud app deploy部署
——我想这将杀死以前的版本并部署新版本。感谢更新。我认为Cloud Run现在可以兼容了,它支持双向流,并且请求超时限制在60分钟之内!所以,这不是主题。@JohnMichaelG的想法是正确的!如果您没有其他服务和其他活动版本(实例数为1),我不知道这些额外费用从何而来!