How Instances are Managed

Google manages all the instances running in the flexible environment.


Health checking

App Engine sends periodic health check requests to confirm that an instance has been successfully deployed, and to check that a running instance maintains a healthy status. Each health check must be answered within a specified time interval. An instance is unhealthy when it fails to respond to a specified number of consecutive health check requests. An unhealthy instance will not receive any client requests, but health checks will still be sent. If an unhealthy instance continues to fail to respond to a predetermined number of consecutive health checks, it will be restarted.

Health check requests are enabled by default, with default threshold values. You can customize health checking by adding an optional health check section to your app's configuration file.

You do not have to do anything special to implement health checking. If your app does not handle health checks, a HTTP 404 response is interpretated as a successful reply.

If you are using an App Engine Standard compatible runtime a healthy instance will respond with status code 200.

You can write your own custom health-checking code. It should reply to /_ah/health requests with a HTTP status code 200. The response must include a message body, however, the value of the body is ignored (it can be empty).

Instance uptime

App Engine attempts to keep manual scaling instances running indefinitely, but there is no uptime guarantee. Hardware or software failures that cause early termination or frequent restarts can occur without warning and can take considerable time to resolve. Your application should be able to handle such failures.

Here are some good strategies for avoiding downtime due to instance restarts:

  • Use load balancing across multiple instances.
  • Configure more instances than required to handle normal traffic.
  • Write fall-back logic that uses cached results when a manual scaling instance is unavailable.
  • Reduce the amount of time it takes for your instances to start up and shutdown.
  • Duplicate the state information across more than one instance.
  • For long-running computations, checkpoint the state from time to time so you can resume it if it doesn't complete.

Automatic weekly restarts and system updates

All flexible instances are restarted on a weekly basis. During restarts, critical, backwards-compatible updates are automatically rolled out to the underlying operating system. Your application's image will remain the same across restarts.


Instances are automatically located by geographical region according to the project settings. All the instances for the same project are co-located for optimal performance.

Send feedback about...

App Engine flexible environment for Java docs