Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Network connection leak #4679

@arkpar

Description

@arkpar

Currently substrate is based on libp2p 0.14.0-alpha.1 which has a few issues:

  1. Network opens a lot of TCP connections. After running for a few hours on kusama the number of connections reported by lsof is over 2000.
  2. Each connection preallocates at least 176 kbytes of memory for buffers in the noise protocol.
    Which leads to memory usage in hundreds of megabytes.
  3. Each connection spawns a short-lived thread, which leads to a leak in sysinfo crate.

Each of these should be fixed as soon as possible. Substrate already has a limit for protocol connections. That limit must be enforced as a global limit for TCP connections, including Kademlia and all other protocols.

All buffers should be preallocated to some small size, like 1k. The rest should be allocated lazily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I3-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions