1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/etcd-consensus-latency.adoc
2025-10-10 15:58:36 +00:00

71 lines
2.4 KiB
Plaintext

// Module included in the following assemblies:
//
// * etcd/etcd-performance.adoc
:_mod-docs-content-type: PROCEDURE
[id="etcd-consensus-latency_{context}"]
= Monitoring consensus latency for etcd
By using the `etcdctl` CLI, you can monitor the latency for reaching consensus as experienced by etcd. You must identify one of the etcd pods and then retrieve the endpoint health.
This procedure, which validates and monitors cluster health, can be run only on an active cluster.
.Prerequisites
* During planning for cluster deployment, you completed the disk and network tests.
.Procedure
. Enter the following command:
+
[source,terminal]
----
# oc get pods -n openshift-etcd -l app=etcd
----
+
.Example output
[source,terminal]
----
NAME READY STATUS RESTARTS AGE
etcd-m0 4/4 Running 4 8h
etcd-m1 4/4 Running 4 8h
etcd-m2 4/4 Running 4 8h
----
. Enter the following command. To better understand the etcd latency for consensus, you can run this command on a precise watch cycle for a few minutes to observe that the numbers remain below the ~66 ms threshold. The closer the consensus time is to 100 ms, the more likely the cluster will experience service-affecting events and instability.
+
[source,terminal]
----
# oc exec -ti etcd-m0 -- etcdctl endpoint health -w table
----
+
.Example output
[source,terminal]
----
+----------------------------+--------+-------------+-------+
| ENDPOINT | HEALTH | TOOK | ERROR |
+----------------------------+--------+-------------+-------+
| https://198.18.111.12:2379 | true | 3.798349ms | |
| https://198.18.111.14:2379 | true | 7.389608ms | |
| https://198.18.111.13:2379 | true | 6.263117ms | |
+----------------------------+--------+-------------+-------+
----
. Enter the following command:
+
[source,terminal]
----
# oc exec -ti etcd-m0 -- watch -dp -c etcdctl endpoint health -w table
----
+
.Example output
[source,terminal]
----
+----------------------------+--------+-------------+-------+
| ENDPOINT | HEALTH | TOOK | ERROR |
+----------------------------+--------+-------------+-------+
| https://198.18.111.12:2379 | true | 9.533405ms | |
| https://198.18.111.13:2379 | true | 4.628054ms | |
| https://198.18.111.14:2379 | true | 5.803378ms | |
+----------------------------+--------+-------------+-------+
----