Skip to content

Commit d0ed82b

Browse files
authored
Health checks liveness and readiness (#18873)
1 parent 7f92fb1 commit d0ed82b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

aspnetcore/host-and-deploy/health-checks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to set up health checks for ASP.NET Core infrastructure,
55
monikerRange: '>= aspnetcore-2.2'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 12/15/2019
8+
ms.date: 06/22/2020
99
no-loc: [Blazor, "Identity", "Let's Encrypt", Razor, SignalR]
1010
uid: host-and-deploy/health-checks
1111
---
@@ -431,10 +431,10 @@ Unhealthy
431431

432432
In some hosting scenarios, a pair of health checks are used that distinguish two app states:
433433

434-
* The app is functioning but not yet ready to receive requests. This state is the app's *readiness*.
435-
* The app is functioning and responding to requests. This state is the app's *liveness*.
434+
* *Readiness* indicates if the app is running normally but isn't ready to receive requests.
435+
* *Liveness* indicates if an app has crashed and must be restarted.
436436

437-
The readiness check usually performs a more extensive and time-consuming set of checks to determine if all of the app's subsystems and resources are available. A liveness check merely performs a quick check to determine if the app is available to process requests. After the app passes its readiness check, there's no need to burden the app further with the expensive set of readiness checks—further checks only require checking for liveness.
437+
Consider the following example: An app must download a large configuration file before it's ready to process requests. We don't want the app to be restarted if the initial download fails because the app can retry downloading the file several times. We use a *liveness probe* to describe the liveness of the process, no additional checks are performed. We also want to prevent requests from being sent to the app before the configuration file download has succeeded. We use a *readiness probe* to indicate a "not ready" state until the download succeeds and the app is ready to receive requests.
438438

439439
The sample app contains a health check to report the completion of long-running startup task in a [Hosted Service](xref:fundamentals/host/hosted-services). The `StartupHostedServiceHealthCheck` exposes a property, `StartupTaskCompleted`, that the hosted service can set to `true` when its long-running task is finished (*StartupHostedServiceHealthCheck.cs*):
440440

@@ -1144,10 +1144,10 @@ Unhealthy
11441144

11451145
In some hosting scenarios, a pair of health checks are used that distinguish two app states:
11461146

1147-
* The app is functioning but not yet ready to receive requests. This state is the app's *readiness*.
1148-
* The app is functioning and responding to requests. This state is the app's *liveness*.
1147+
* *Readiness* indicates if the app is running normally but isn't ready to receive requests.
1148+
* *Liveness* indicates if an app has crashed and must be restarted.
11491149

1150-
The readiness check usually performs a more extensive and time-consuming set of checks to determine if all of the app's subsystems and resources are available. A liveness check merely performs a quick check to determine if the app is available to process requests. After the app passes its readiness check, there's no need to burden the app further with the expensive set of readiness checks—further checks only require checking for liveness.
1150+
Consider the following example: An app must download a large configuration file before it's ready to process requests. We don't want the app to be restarted if the initial download fails because the app can retry downloading the file several times. We use a *liveness probe* to describe the liveness of the process, no additional checks are performed. We also want to prevent requests from being sent to the app before the configuration file download has succeeded. We use a *readiness probe* to indicate a "not ready" state until the download succeeds and the app is ready to receive requests.
11511151

11521152
The sample app contains a health check to report the completion of long-running startup task in a [Hosted Service](xref:fundamentals/host/hosted-services). The `StartupHostedServiceHealthCheck` exposes a property, `StartupTaskCompleted`, that the hosted service can set to `true` when its long-running task is finished (*StartupHostedServiceHealthCheck.cs*):
11531153

0 commit comments

Comments
 (0)