# HA ZET connection to Controllers

**URL:** <https://openziti.discourse.group/t/ha-zet-connection-to-controllers/4503>\
**Category:** Uncategorized\
**Created:** [May 9, 2025, 2:33pm UTC](https://openziti.discourse.group/t/ha-zet-connection-to-controllers/4503 "2025-05-09T14:33:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![farmhouse](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@farmhouse](https://openziti.discourse.group/u/farmhouse)\
**Post date:** [May 9, 2025, 2:33pm UTC](https://openziti.discourse.group/t/ha-zet-connection-to-controllers/4503/1 "2025-05-09T14:33:24Z")

</div>

Hi Again,

I've got a 3 Controller HA system `v1.5.4`.

I'm trying to understand what factors affect which Controller the ZET client chooses to connect to. I'd also like to know if there's anything that would cause the ZET client to move to a different controller other than the current controller becoming unavailable.

In my system i see client connections to controllers unevenly distributed. For example, roughly 50% of clients connect to Controller 1, 25% to Controller 2 and 25% to controller 3.

Is there a way to see the Controller that clients are connected to from the `ziti` cli ? Currently i'm grepping the ZET logs to get this information. For example i'd like to see how many clients are connected to each controller.

---

<div class="post-metadata">

**Author:** ![ekoby](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/ekoby/32/14_2.png) [@ekoby](https://openziti.discourse.group/u/ekoby)\
**Post date:** [May 9, 2025, 3:57pm UTC](https://openziti.discourse.group/t/ha-zet-connection-to-controllers/4503/2 "2025-05-09T15:57:28Z")

</div>

there is no really such thing as _being connected to a controller_.  
SDK just needs to periodically hit controller API with REST requests. SDK may decide to switch to another controller for the next set of requests if _current_ controller is offline, or after coming out of sleep.

The switch logic is non-deterministic. SDK is trying to randomize controller selection to avoid herding between different endpoints:  
for example if ctrl1 went offline, we don't want all endpoints to switch ctrl2, we want to split them equally between active controllers.

This process may change in the future, but it general you can't infer anything from the current distribution. over a longer time period all controllers should be utilized equally especially once you have a larger client population.

---

<div class="post-metadata">

**Author:** ![farmhouse](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@farmhouse](https://openziti.discourse.group/u/farmhouse)\
**Post date:** [May 12, 2025, 7:02am UTC](https://openziti.discourse.group/t/ha-zet-connection-to-controllers/4503/3 "2025-05-12T07:02:50Z")

</div>

Thanks @ekoby for your answer !

---

<div class="post-metadata">

**Author:** ![farmhouse](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@farmhouse](https://openziti.discourse.group/u/farmhouse)\
**Post date:** [May 19, 2025, 11:01am UTC](https://openziti.discourse.group/t/ha-zet-connection-to-controllers/4503/4 "2025-05-19T11:01:26Z")

</div>

@ekoby.

The documentation [mentions here](https://openziti.io/docs/reference/ha/overview#why-cluster-controllers) that a HA controller could be placed geographically close to clients to reduce latency. But how would these clients know to use the geographically closer Controller rather than the others in the HA cluster ?

---

<div class="post-metadata">

**Author:** ![ekoby](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/ekoby/32/14_2.png) [@ekoby](https://openziti.discourse.group/u/ekoby)\
**Post date:** [May 19, 2025, 1:14pm UTC](https://openziti.discourse.group/t/ha-zet-connection-to-controllers/4503/5 "2025-05-19T13:14:57Z")

</div>

That is an excellent question!

In my opinion, placement of controllers relative to SDK endpoints does not play a big role in latencies because SDK caches most of the data it receives from controller(s) and overlay connections are usually established without SDK contacting a controller.

However, there is an indirect effect:

- Edge Router(s) placement is important to SDK endpoints, putting them closer to your apps will reduce overlay connection latency.
- Edge routers do communicate with controllers when establishing connections, so you want HA controllers close to your routers.
