Google manages all the instances running in the flexible environment.
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
You can write your own custom health-checking code.
It should reply to
/_ah/health requests with a HTTP status code
response must include a message body, however, the value of the body is ignored
(it can be empty).
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.