# Is OneAgent selection of AG based on load and latency?

**URL:** <https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608>\
**Category:** Open Q&A\
**Tags:** activegate, oneagent, documentation\
**Created:** [February 27, 2020, 1:37pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608 "2020-02-27T13:37:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [February 27, 2020, 1:37pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608/1 "2020-02-27T13:37:28Z")

</div>

Describing how OneAgents determine which AG to connect to, the page at the link below states that “_If more than one such ActiveGate is available, OneAgents will try to switch between the available ActiveGates on a regular basis **to achieve proper load balancing**._”

> **[Supported connectivity schemes for ActiveGates](https://docs.dynatrace.com/docs/ingest-from/dynatrace-activegate/supported-connectivity-schemes-for-activegates)**
>
> Learn about the connectivity priorities between ActiveGate types as well as the priorities between ActiveGates and OneAgents.

I had previously thought (assumed) that the OneAgents would be checking network latency to the AGs and would pick the one with lowest latency (within AGs of a specific type, such as Environment AG). Is that not the case, or are BOTH load and latency taken into consideration?

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [February 27, 2020, 2:42pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608/2 "2020-02-27T14:42:48Z")

</div>

As I know this is only based on AG load, not latency. When we are making deployments, group of agents has access via network to only one AG. If there are some extra considerations here I would be happy to get such informations as well 🙂

Sebastian

---

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [February 27, 2020, 3:18pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608/3 "2020-02-27T15:18:09Z")

</div>

If that is the case then my concern is that agents will often end up not connecting to the “local” AG (i.e., one in the same data center as the agent) but will instead be sending data to AGs that are located in other data centers… not very efficient from a network perspective

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [February 27, 2020, 3:24pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608/4 "2020-02-27T15:24:06Z")

</div>

![23804-1f456735-52d8-4d35-bf13-f701b8b70cbf.jpeg](https://global.discourse-cdn.com/dynatrace/original/1X/1190632fc4ba4b16061020ac97bb3ceb6321b469.jpeg)

According to this doc, OneAgent will prefer AG that is closer. In such case this shouldn’t be issue for you.

Sebastian

---

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [February 27, 2020, 4:09pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608/5 "2020-02-27T16:09:18Z")

</div>

I understand the hierarchy of preference between the Environment and Cluster AGs and of these over a direct connection to the cluster, but that view of closeness does not relate to the actual network distance… so when we have multiple Environent AGs (as we do) the documentation does not appear to state that the one that is actually closest or has the least latency will be selected.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [February 27, 2020, 4:20pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608/6 "2020-02-27T16:20:19Z")

</div>

Latency might be very volatile. I think balancing is only dependent on the number of connections or on amount of data.

---

<div class="post-metadata">

**Author:** ![jeff\_rowell](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jeff\_rowell](https://community.dynatrace.com/u/jeff_rowell)\
**Post date:** [February 27, 2020, 4:32pm UTC](https://community.dynatrace.com/t/is-oneagent-selection-of-ag-based-on-load-and-latency/18608/7 "2020-02-27T16:32:37Z")

</div>

Perhaps, although I would think that there would often be significant differences between geographically remove sites… so it surprises me that the algorithm does not take that into consideration… But thanks for confirming that it is based on load (connections & traffic volumes) only.
