-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reduce number of connections #4695
Comments
May I ask what is the reason to reduce the number of connections? Number of connections influences the network topology with the consequence of changing the number of hops required for a chunk to reach the desired node. It would be good to measure what is the benefit in respect of the download and upload performance (speed and resource consumption) before settling on the saturation peers count. I would even say that a dynamic saturation peers count is a good thing to have based on the network conditions, but that would be a bit larger feature to add. |
That reminds me of an old branch from 3 years ago :) #2530 I believe we can achieve better performance by having higher peer count for shallower bins and fewer peers for deeper bins. This may seem counterintuitive but on average half of the chunk requests will go to bin 0 because relative to your address, half of the network falls in your bin 0. So instead of having a constant 16 suffix addresses (4 bits) to balance the bins, image that we have 64 balanced addresses for bin 0, then 32 for bin 1, 16 for bin 3, 8 for the rest of bins, request hops could be drastically reduced, and the total sum of connection count will lower than 200. |
That is a very interesting approach. I am not sure why #2530 is abandoned, as it has potential. I believe that research team should validate it before making changes to the topology. There is also a possibility that by reducing the number of peers in bins can result with the same or even higher syncing activity as the number of hops is increased. But, any assumptions should be validated by measuring changes in syncing and retrieving time and system resources consumption. |
I believe the origin of this request is due to some home routers becoming completely saturated and leaving the local network unusable when multiple bee nodes are run. |
A configurable maximal number of connected peers would be good to have for such situations for users to fine tune based on resources. Kademlia already has SaturationPeers in its Options struct it just is not configurable using cli flags or configuration files. I still believe that reducing the number of peers is not the best solution, but to address the issue in the syncing protocols. |
This should definitely be a SWIP first. Actually, the peercount in the PO bins ought to be chosen to reflect 1) the connectivity restrictions of a node and 2) the throughput requierments.
(2) is working the following way. Our ultimate goal is to handle requests most efficiently, i.e., to potentially max out the throughput of each peer in the event of a lot of requests. You need to connect to each node within the neighbourhood designated by the storage depth D, i.e., cca S*2^{-D} Interestingly, if you are a node operator and not using the API, ie. only do forwarding for full nodes with saturated kademlia table, then the distribution of requests is constant across bins so you need to put So,
now go figure |
The ultimate solution though should probably be directly driven by throughput. If some peers max out, then we open a connection to a peer that is a PO deepest new sister to that node |
Actions taken so far:
|
currently on mainnet, average number of connections is around 200 connections per node, and this is mainly due to the high storage radius and high number of nodes (relative to the radius) so the max connections per bin should be adjusted.
We can achieve this by reducing the over saturation peers count from 20 to 16 in kademlia.
The text was updated successfully, but these errors were encountered: