0

我是 GCP 应用程序引擎的新手——我有一个 node.js 应用程序在应用程序引擎 flex 上运行。目前,Google 每月向我收取超过 3500 小时的弹性实例核心小时数。他们告诉我我正在使用多个实例,这就是为什么需要大量时间。但是,我已将 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]

4

1 回答 1

0

To answer this question, your 3500 hours of flex instance core hours per month came from the App Engine Flex old version deployed. Because The App Engine Flex runs on a Virtual Machine and whenever you deploy a new version using the command gcloud app deploy, the old one is still running even without a traffic. To replace the previous version the old version by the new deployment use the gcloud command:

  • gcloud app deploy --version=VERSION

Also to delete/stop the version, you can do this in Google Cloud Console(App Engine > Version) then check all the versions you want to delete/stop or via gcloud command:

  • gcloud app versions delete VERSIONS
  • gcloud app versions stop VERSIONS

If contacting Google Billing department still can't explain where the charges came from, I believe contacting the Google Cloud Tech Support might give more explanation for this.

于 2020-10-12T20:19:42.953 回答