Skip to content

Cluster Clients

Aeron Cluster allows a limited number of cluster clients to connect simultaneously (10 is the default). While you can override the base limit, care must be taken note to overload the Consensus Module with too many cluster clients.

To override the maximum connected clients, you must either:

  • set the property aeron.cluster.max.sessions to a new number
  • set the ConsensusModule.Context.maxConcurrentSessions to a new number

Note that there can be situations when the count is seemingly higher than possible. For example, if you have 20 clients connected, and set the aeron.cluster.max.sessions to 20, and you have a client timeout. If the cluster client reconnects before being removed from the internal cluster sessions map, then you will receive a concurrent session limit error message. To be safe, set it slightly higher than the actual number of clients expected to connect.

Cluster Clients & AeronStat

Once a cluster client connects to an Aeron Cluster process, the following side effects are visible in the Cluster's AeronStat:

  • a subscription opens on stream 101
  • a publication opens on stream 102
  • data starts moving on publication stream 100

And in the client's AeronStat output we see:

  • a publication opens on stream 101
  • a subscription opens on stream 102

Aeron Cluster view

In an Aeron Cluster with a single connected client, the highlighted lines are added to the AeronStat output:

71:              636,896 - ssub-pos: 43 -1365430415 101 aeron:udp?term-length=64k|endpoint=localhost:9003 @0
72:                    1 - snd-channel: aeron:udp?fc=min,t:5s|control=localhost:9007|tags=36,35|term-length=65536|ssc=true|control-mode=manual|alias=log 127.0.0.1:9007
73:                    1 - snd-local-sockaddr: 72 127.0.0.1:9007
74:                9,920 - pub-pos (sampled): 37 729594556 100 aeron:udp?fc=min,t:5s|control=localhost:9007|tags=36,35|term-length=65536|ssc=true|control-mode=manual|alias=log
75:               42,688 - pub-lmt: 37 729594556 100 aeron:udp?fc=min,t:5s|control=localhost:9007|tags=36,35|term-length=65536|ssc=true|control-mode=manual|alias=log
76:                9,920 - snd-pos: 37 729594556 100 aeron:udp?fc=min,t:5s|control=localhost:9007|tags=36,35|term-length=65536|ssc=true|control-mode=manual|alias=log
77:                9,920 - snd-lmt: 37 729594556 100 aeron:udp?fc=min,t:5s|control=localhost:9007|tags=36,35|term-length=65536|ssc=true|control-mode=manual|alias=log
78:                    0 - snd-bpe: 37 729594556 100 aeron:udp?fc=min,t:5s|control=localhost:9007|tags=36,35|term-length=65536|ssc=true|control-mode=manual|alias=log
79:                9,920 - sub-pos: 39 729594556 100 aeron-spy:aeron:udp?tags=36|control=localhost:9007|control-mode=manual|session-id=729594556|alias=log @0
80:                9,920 - rec-pos: 0 729594556 100 aeron:udp?tags=36|control=localhost:9007|control-mode=manual|session-id=729594556|alias=log
81:                9,920 - sub-pos: 41 729594556 100 aeron-spy:aeron:udp?control=localhost:9007|tags=36|term-length=65536|control-mode=manual|session-id=729594556|alias=log @0
82:                    1 - rcv-channel: aeron:udp?term-length=64k|endpoint=localhost:9003 127.0.0.1:9003
83:                    1 - rcv-local-sockaddr: 82 127.0.0.1:9003
84:              637,024 - rcv-hwm: 44 -1365430415 101 aeron:udp?term-length=64k|endpoint=localhost:9003
85:              637,024 - rcv-pos: 44 -1365430415 101 aeron:udp?term-length=64k|endpoint=localhost:9003
86:                    1 - snd-channel: aeron:udp?endpoint=localhost:19000 127.0.0.1:63129
87:                    1 - snd-local-sockaddr: 86 127.0.0.1:63129
88:                9,792 - pub-pos (sampled): 45 729594557 102 aeron:udp?endpoint=localhost:19000
89:            8,398,400 - pub-lmt: 45 729594557 102 aeron:udp?endpoint=localhost:19000
90:                9,792 - snd-pos: 45 729594557 102 aeron:udp?endpoint=localhost:19000
91:              140,864 - snd-lmt: 45 729594557 102 aeron:udp?endpoint=localhost:19000
92:                    0 - snd-bpe: 45 729594557 102 aeron:udp?endpoint=localhost:19000

Aeron Cluster Client view

And the same streams as seen from the Aeron Cluster client:

 31:            3,889,568 - pub-pos (sampled): 3 -1365430415 101 aeron:udp?endpoint=localhost:9003
 32:           12,294,560 - pub-lmt: 3 -1365430415 101 aeron:udp?endpoint=localhost:9003
 33:            3,905,952 - snd-pos: 3 -1365430415 101 aeron:udp?endpoint=localhost:9003
 34:            4,032,672 - snd-lmt: 3 -1365430415 101 aeron:udp?endpoint=localhost:9003
 35:                    0 - snd-bpe: 3 -1365430415 101 aeron:udp?endpoint=localhost:9003
 36:                9,792 - sub-pos: 2 729594557 102 aeron:udp?endpoint=localhost:19000 @0
 37:                9,792 - rcv-hwm: 5 729594557 102 aeron:udp?endpoint=localhost:19000
 38:                9,792 - rcv-pos: 5 729594557 102 aeron:udp?endpoint=localhost:19000

Interpreting the counters

The counters are no different from other Aeron Positions. Specific items to consider:

  • Backpressure is no less possible with Aeron Cluster. If you have the cluster (or the cluster client for that matter) publishing faster than the recipient can receive, you will have backpressure errors raised. See counter 35 on the Aeron Cluster Client AeronStat and counter 92 on the Aeron Cluster AeronStat.
    • If the stream 102 is having backpressure, then your cluster is running faster than your client can accept (or the network between the cluster and cluster client is slow)
    • If the stream 101 has backpressure, then it is the cluster client that is sending data faster than the cluster can accept, or the network is too slow from cluster client to cluster.
  • If the positions on the Aeron Cluster for a client on streams 101 and 102 are all 0, then the cluster is having trouble with the connection. This connection may not recover.
Back to top