You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/service-fabric/probes-codepackage.md
+26-10Lines changed: 26 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,39 @@
1
1
---
2
2
title: Azure Service Fabric probes
3
-
description: How to model a liveness probe in Azure Service Fabric by using application and service manifest files.
3
+
description: How to model a liveness and readiness probe in Azure Service Fabric by using application and service manifest files.
4
4
5
5
ms.topic: conceptual
6
6
author: tugup
7
7
ms.author: tugup
8
8
ms.date: 3/12/2020
9
9
---
10
-
# Liveness probe
11
-
Starting with version 7.1, Azure Service Fabric supports a liveness probe mechanism for [containerized][containers-introduction-link] applications. A liveness probe helps to report the liveness of a containerized application, which will restart if it doesn't respond quickly.
12
-
This article provides an overview of how to define a liveness probe by using manifest files.
13
10
14
-
Before you proceed with this article, become familiar with the [Service Fabric application model][application-model-link] and the [Service Fabric hosting model][hosting-model-link].
11
+
# Service Fabric Probes
12
+
Before you proceed with this article, become familiar with the [Service Fabric application model][application-model-link] and the [Service Fabric hosting model][hosting-model-link]. This article provides an overview of how to define a liveness and readiness probe by using manifest files.
15
13
16
-
> [!NOTE]
17
-
> Liveness probe is supported only for containers in NAT networking mode.
14
+
## Liveness probe
15
+
Starting with version 7.1, Azure Service Fabric supports a liveness probe mechanism for containerize and non containerized applications. A liveness probe helps to report the liveness of a code package, which will restart if it doesn't respond quickly.
16
+
17
+
## Readiness probe
18
+
Starting with 8.2, readiness probe is also supported. A readiness probe is used to decide whether a code package is ready to accept traffic. For example if your container is taking a long time to process request or if the request queue is full, then your code package cannot accept anymore traffic and hence the endpoints to reach the code package will be removed.
19
+
20
+
The behavior of the Readiness Probe is:
21
+
1. The container/code package instance starts
22
+
2. Endpoints are published immediately
23
+
3. Readiness Probe starts running
24
+
4. Readiness Probe eventually reaches failure threshold, and the endpoint is removed making it unavailable
25
+
5. Instance eventually becomes ready
26
+
6. Readiness Probe notices the instance is ready and publishes endpoint again
27
+
7. Requests are routed again and succeed since it was ready to serve requests
28
+
29
+
> [!NOTE]
30
+
> For Readiness probe, the code package is not restarted, just the endpoints are unpublished so the replica/partition set in not impacted.
31
+
>
18
32
19
33
## Semantics
20
-
You can specify only one liveness probe per container and can control its behavior by using these fields:
34
+
You can specify only one liveness and one readiness probe per code package and can control its behavior by using these fields:
35
+
36
+
*`type`: Used to specify whether the probe type is Liveness or Readiness. Supported values are **Liveness** or **Readiness**
21
37
22
38
*`initialDelaySeconds`: The initial delay in seconds to start executing the probe after the container has started. The supported value is **int**. The default is 0 and the minimum is 0.
23
39
@@ -41,7 +57,7 @@ Additionally, Service Fabric will raise the following probe [health reports][hea
41
57
* The probe fails and **failureCount** < **failureThreshold**. This health report stays until **failureCount** reaches the value set in **failureThreshold** or **successThreshold**.
42
58
* On success after failure, the warning remains but with updated consecutive successes.
43
59
44
-
## Specifying a liveness probe
60
+
## Specifying a probe
45
61
46
62
You can specify a probe in the ApplicationManifest.xml file under **ServiceManifestImport**.
47
63
@@ -55,7 +71,7 @@ The probe can be for any of the following:
55
71
56
72
For an HTTP probe, Service Fabric will send an HTTP request to the port and path that you specify. A return code that is greater than or equal to 200, and less than 400, indicates success.
57
73
58
-
Here is an example of how to specify an HTTP probe:
74
+
Here is an example of how to specify an HTTP Liveness probe:
0 commit comments