Kravitz
Kravitz

Reputation: 2859

App Engine Flex configuration very slow taking 10+ mins for a simple nodejs app

I am using standard env for 2 other services on app engine and they deploy super fast but the one service using flex takes 10+ minutes despite it being simple, does anyone see any issues with my app.yaml that might cause it to take so long, its quite a pain to wait 10+ mins for a fix to deploy

      runtime: nodejs
      env: flex
      service: api

      runtime_config:
        operating_system: "ubuntu22"
        runtime_version: "18"

      manual_scaling:
        instances: 1

      resources:
        cpu: 1
        memory_gb: 1
        disk_size_gb: 10

      handlers:
        - url: /.*
          secure: always
          script: auto

      readiness_check:
        path: "/health"
        check_interval_sec: 5
        timeout_sec: 4
        failure_threshold: 2
        success_threshold: 2
        app_start_timeout_sec: 180

      network:
        session_affinity: true

Upvotes: 0

Views: 105

Answers (1)

J_Dubu
J_Dubu

Reputation: 169

Deployment:

Deployments in standard environment are generally faster than deployments in flexible environment. It is faster to scale up an existing version in flexible environment than to deploy a new version, because the network programming for a new version is normally the long pole in a flexible environment deployment. One strategy for doing quick rollbacks in flexible environment is to maintain a known good version scaled down to a single instance. You can then scale up that version and then route all traffic to it using Traffic Splitting.

Note that Google App Engine flexible environment is based on Google Compute Engine, so it takes time to configure the infrastructure when you deploy your app.

The first deployment of a new version of an App Engine Flexible application takes some time due to setting up of internal infrastructure, however subsequent deployments should be relatively fast since it only modifies some GCP resources and then waits on the health checks.

The sample flex app already took 7 minutes to deploy. With readiness_check, it takes more time.

Found a similar request to make the deployment faster. You can upvote/comment on this public issue tracker.

As a last resort, try exploring Cloud Run instead of Google App Engine flex. Since GAE flexible is running on VMs, it is a bit slower than Cloud Run to deploy a new revision of your app, and scale up. Cloud Run deployments are faster.

Upvotes: 0

Related Questions