Choosing an App Engine environment

You can run your applications in App Engine using the flexible environment or standard environment. You can also choose to simultaneously use both environments for your application and allow your services to take advantage of each environment's individual benefits.

The App Engine environments

App Engine is well suited to applications that are designed using a microservice architecture, especially if you decide to utilize both environments. Use the following sections to learn and understand which environment best meets your application's needs.

When to choose the standard environment

Application instances run in a sandbox, using the runtime environment of a supported language listed below.

Applications that need to deal with rapid scaling.

The standard environment is optimal for applications with the following characteristics:

  • Source code is written in specific versions of the supported programming languages:
    • Python 2.7, Python 3.7
    • Java 8, Java 11 (beta)
    • Node.js 8, Node.js 10
    • PHP 5.5, PHP 7.2, and PHP 7.3 (beta)
    • Go 1.9, Go 1.11, and Go 1.12
  • Intended to run for free or at very low cost, where you pay only for what you need and when you need it. For example, your application can scale to 0 instances when there is no traffic.
  • Experiences sudden and extreme spikes of traffic which require immediate scaling.

When to choose the flexible environment

Application instances run within Docker containers on Compute Engine virtual machines (VM).

Applications that receive consistent traffic, experience regular traffic fluctuations, or meet the parameters for scaling up and down gradually.

The flexible environment is optimal for applications with the following characteristics:

  • Source code that is written in a version of any of the supported programming languages:
    Python, Java, Node.js, Go, Ruby, PHP, or .NET
  • Runs in a Docker container that includes a custom runtime or source code written in other programming languages.
  • Uses or depends on frameworks that include native code.
  • Accesses the resources or services of your Google Cloud Platform project that reside in the Compute Engine network.

Comparing high-level features

The following table summarizes the differences between the two environments:

Feature Standard environment Flexible environment
Instance startup time Seconds Minutes
Maximum request timeout 60 seconds - Learn more 60 minutes
Background threads Yes, with restrictions Yes
Background processes No Yes
SSH debugging No Yes
Scaling Manual, Basic, Automatic Manual, Automatic
Scale to zero Yes No, minimum 1 instance
Writing to local disk
  • Java 8, Java 11 (beta), Node.js, Python 3.7, PHP 7.2, PHP 7.3 (beta), Go 1.11, and Go 1.12 have read and write access to the /tmp directory.
  • Python 2.7, Go 1.9, and PHP 5.5 don't have write access to the disk.
Yes, ephemeral (disk initialized on each VM startup)
Modifying the runtime No Yes (through Dockerfile)
Deployment time Seconds Minutes
Automatic in-place security patches Yes Yes (excludes container image runtime)
Access to App Engine APIs & Services such as NDB, Users API, Memcache, Images API and others.
  • Yes for Python 2.7, Go 1.9, PHP 5.5, and Java 8
  • No for Java 11 (beta), Node.js, Python 3.7, PHP 7.2, PHP 7.3 (beta), Go 1.11, and Go 1.12
No
Network access
  • Yes for Java 8, Java 11 (beta), Node.js, Python 3.7, PHP 7.2, PHP 7.3 (beta), Go 1.11, and Go 1.12.
  • Python 2.7, Go 1.9, and PHP 5.5 (billing-enabled): Only via App Engine services (includes outbound sockets).
Yes
Supports installing third-party binaries
  • Yes for Java 8, Java 11 (beta) Node.js, Python 3.7, PHP 7.2, PHP 7.3 (beta), Go 1.11, and Go 1.12.
  • No for Python 2.7, Go 1.9, and PHP 5.5.
Yes
Location North America, Asia Pacific, or Europe North America, Asia Pacific, or Europe
Pricing Based on instance hours Based on usage of vCPU, memory, and persistent disks

For an in-depth comparison of the environments, see the guide for your language: Python, Java, Go, or PHP.

Comparing the flexible environment to Compute Engine

The App Engine flexible environment has the following differences to Compute Engine:

  • Flexible environment VM instances are restarted on a weekly basis. During restarts, Google's management services apply any necessary operating system and security updates.

  • You always have root access to Compute Engine VM instances. By default, SSH access to the VM instances in the flexible environment is disabled. If you choose, you can enable root access to your app's VM instances.

  • Code deployments can take longer as container images are built by using the Cloud Build service.

  • The geographical region of a flexible environment VM instance is determined by the location that you specify for the App Engine application of your GCP project. Google's management services ensures that the VM instances are co-located for optimal performance.

Migrating from standard to the flexible environment

If you have an application in the standard environment, you might want to move some services to the flexible environment. For guidance, see the recommendations for Python, Java, Go, and PHP.

To migrate specific services, see the instructions for Python, Java, Go, and PHP.

이 페이지가 도움이 되었나요? 평가를 부탁드립니다.

다음에 대한 의견 보내기...

App Engine Documentation