Let's hit max peers!

I’m running go-ipfs 0.4.21 on a larger server node hosted on the Internet running Ubuntu 16.04.6. The only purpose of this server is IPFS hosting. I’m trying to connect to as many peers as possible without maxing out processing or bandwidth of the server. (Just to see what happens) At this point I have increased my highwater mark to 10000 peers and the server stops finding peers around 4100 peers with 0% CPU and some but, very little bandwidth usage and memory utilization. I’m assuming there is some additional configuration on the linux side that I need to do and would like some guidance to make this work. Any and all suggestions welcome.

1 Like

the server stops finding peers around 4100 peers with 0% CPU and some but, very little bandwidth usage and memory utilization

That sounds impressive! Does it actually work properly (decent speed for content discovery) with that many peer?

You may have hit the maximum number of open file descriptors.
You can increase using ulimit -n 65553 on the shell or LimitNOFILE=65553 in a systemd unit file.

If you run into a hard limit (shell-only) you’ll also have to increase the hard limit in /etc/security/limits.conf and add a line such as this:

* hard nofile 65553

… then log out and back in.

1 Like

On a slightly different, but related note, IPFS should strongly consider (re)using the Mainline DHT for finding its peers. It is about 10Million node strong currently, which would mean high performance gains for IPFS, if it can be piggybacked on.

Agree with @ntninja, you probably hit the file descriptor limit. I’ve seen 20k+ peers connected to my nodes before