So hereâs some food for thought.
Range represents number of addresses, frequency is number of devices advertising number of addresses in that range.
Query
with counts as (
select count(1) as cnt from addresses where address like 'kcp%' group by deviceid
),
bounds as (
select max(cnt) as max, min(cnt) as min from counts
)
select range, freq from (
select width_bucket(cnt, min, max, 19) as bucket,
int4range(min(cnt)::int, max(cnt)::int, '[]') as range,
count(*) as freq
from counts, bounds
group by bucket
order by bucket
) w;
KCP
range | freq
-----------+-------
[1,19) | 39699
[19,36) | 124
[36,53) | 51
[53,69) | 22
[70,84) | 11
[87,102) | 8
[114,115) | 1
[126,137) | 5
[150,152) | 2
[160,170) | 3
[173,189) | 3
[191,192) | 1
[272,273) | 1
[318,327) | 20
[327,328) | 4
TCP
range | freq
-----------+-------
[1,11) | 67861
[11,21) | 17
[22,23) | 1
[36,37) | 1
[45,46) | 1
[51,52) | 1
[60,61) | 1
[185,186) | 1
Relay
range | freq
-----------+-------
[1,7) | 60371
[7,13) | 391
[13,19) | 54
[19,25) | 36
[25,30) | 14
[30,36) | 15
[36,42) | 8
[42,48) | 8
[48,54) | 7
[54,55) | 2
[59,65) | 5
[68,70) | 4
[76,77) | 1
[77,79) | 4
[85,86) | 1
[90,94) | 2
[97,98) | 1
[104,106) | 2
[106,109) | 11
[111,112) | 1
There seems to be a lot more devices with many KCP addresses advertised than there is with TCP addresses, which given serial fashion of our connections, could contribute to this.
We have merged the parallel dial thing which might help a bit, yet for 50-80 addresses, I am not sure what consequences there will be.