universal-connectivity icon indicating copy to clipboard operation
universal-connectivity copied to clipboard

Rust peer exhausting resources

Open 2color opened this issue 1 year ago • 1 comments

Problem

Every since https://github.com/libp2p/universal-connectivity/pull/114 was merged and the Rust peer is now part of the IPFS Kademlia DHT, it's resource consumption has spiked significantly. It's running on a pretty beefy machine (32GB RAM), yet manages to eat up the CPU cycles from the moment it starts:

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
   1687 root      20   0 1384924   1.0g  33812 S 650.3   3.3  11:30.25 rust-libp2p-web
   1718 root      20   0 2651788 131636  22300 S   2.7   0.4   0:11.17 go-peer

Especially when compared to the go-peer (which also joins the IPFS DHT as a DHT Server)

Potential solutions

It's probably sensible to figure out why the Rust peer is consuming so much resources in order to come up with solutions. We know that this problem started every since it joined the IPFS DHT and connected to the bootstrap nodes.

It may be sensible to instrument the code to figure out why this is happening, in addition to adding some connection limits and having a look at https://github.com/libp2p/rust-libp2p/tree/master/misc/server as a comparison rust-libp2p DHT Server.

2color avatar May 03 '24 13:05 2color

@p-shahi Any thoughts?

2color avatar May 03 '24 15:05 2color