[Idea] Multiple ports for faster overall performance? #20020

issue BenHigh5 opened this issue on September 25, 2020
  1. BenHigh5 commented at 8:49 PM on September 25, 2020: none

    I'm coming at this from the angle of overall throughput of the network. So it looks like the Bitcoin daemon listens on 8333 and 18333 for connections.

    What if, Bitcoin used... say 50 ports, or maybe even just 20 on both sides. I think you'd be able to receive multiple at the same time given they were operating in an asynchronous manner. I'm not sure of the overall code structure, but wouldn't it allow for more throughput overall if both sides were communicating and routing based on open sockets?

    I don't know the deep technicalities of ports and throughput and I know it's not your job to teach me, but I am curious if there's any possible gain here.

  2. BenHigh5 added the label Feature on Sep 25, 2020
  3. sipa commented at 8:52 PM on September 25, 2020: member

    No, this won't have any effect. Multiple sockets on the same port or on different ports have the exact same performance.

    Furthermore, in normal cases performance is not bottlenecked by network code or infrastructure, but by processing the incoming data.

  4. BenHigh5 commented at 8:53 PM on September 25, 2020: none

    Thanks for the reply sipa, So if you had 20 ports opened and were able to process 20 transactions at once on different threads this wouldn't have an overall benefit?

  5. sipa commented at 8:55 PM on September 25, 2020: member

    If that was easy to do, we could also just split the 20 sockets into different threads just as easily.

    This isn't done for a variety of reasons, but being the same port is not one of them.

  6. BenHigh5 commented at 8:57 PM on September 25, 2020: none

    Thanks for the explanation. Now that I think about it it'd be essentially the same as running 20 clients if they are threads. Ah well, gonna keep bumbling ideas around.

  7. sipa closed this on Sep 25, 2020

  8. DrahtBot locked this on Feb 15, 2022
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 12:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me