Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

guide for how to set limits for an application #28

Closed
Tracked by #1711
BigLep opened this issue Jun 1, 2022 · 6 comments
Closed
Tracked by #1711

guide for how to set limits for an application #28

BigLep opened this issue Jun 1, 2022 · 6 comments
Assignees

Comments

@BigLep
Copy link
Contributor

BigLep commented Jun 1, 2022

Done Criteria

A libp2p operator has a self-service guide for how to intelligently set limits for their application.

Why Important

Help operators know how to determine appropriate resource limits for their libp2p application.

User/Customer

Operator of an application using libp2p

Notes

This guide should be part of (or linked from #27).

Ideally the script/notebook would take an input (e.g., trace file, prometheus metrics) and some margin and then output the specific config keys that should be copy/pasted into their go-libp2p config.

It would be ideal to do a visual plot of resource usage over time so one can see if there's an apparent leak or need to increase the margin.

@BigLep
Copy link
Contributor Author

BigLep commented Jun 3, 2022

This was the original/old proposal:

A default approach is to assume that one's libp2p-using application is healthy. They can enable the resource manager, have the limits set to infinite, but also enable tracing. Run the applications for some number of hours/days and then parse the traced results with a script/notebook to set suggested limits.

Below is a sample rcmgr.json.gz trace file.

{
   "Type":0,
   "Limit":{
      "SystemLimits":{
         "Streams":524288,
         "StreamsInbound":131072,
         "StreamsOutbound":524288,
         "Conns":32768,
         "ConnsInbound":16384,
         "ConnsOutbound":16384,
         "FD":16384,
         "Memory":4294967296
      },
      "TransientLimits":{
         "Streams":512,
         "StreamsInbound":128,
         "StreamsOutbound":512,
         "Conns":128,
         "ConnsInbound":32,
         "ConnsOutbound":128,
         "FD":128,
         "Memory":67108864
      },
      "DefaultServiceLimits":{
         "Streams":262144,
         "StreamsInbound":65536,
         "StreamsOutbound":262144,
         "Conns":0,
         "ConnsInbound":0,
         "ConnsOutbound":0,
         "FD":0,
         "Memory":134217728
      },
      "DefaultServicePeerLimits":{
         "Streams":512,
         "StreamsInbound":256,
         "StreamsOutbound":512,
         "Conns":0,
         "ConnsInbound":0,
         "ConnsOutbound":0,
         "FD":0,
         "Memory":33554432
      },
      "ServiceLimits":{
         "libp2p.autonat":{
            "Streams":128,
            "StreamsInbound":128,
            "StreamsOutbound":128,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "libp2p.holepunch":{
            "Streams":256,
            "StreamsInbound":128,
            "StreamsOutbound":128,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "libp2p.identify":{
            "Streams":256,
            "StreamsInbound":128,
            "StreamsOutbound":128,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "libp2p.ping":{
            "Streams":128,
            "StreamsInbound":128,
            "StreamsOutbound":128,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "libp2p.relay/v1":{
            "Streams":1024,
            "StreamsInbound":1024,
            "StreamsOutbound":1024,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "libp2p.relay/v2":{
            "Streams":1024,
            "StreamsInbound":1024,
            "StreamsOutbound":1024,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         }
      },
      "ServicePeerLimits":{
         "libp2p.autonat":{
            "Streams":2,
            "StreamsInbound":2,
            "StreamsOutbound":2,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":557056
         },
         "libp2p.holepunch":{
            "Streams":2,
            "StreamsInbound":2,
            "StreamsOutbound":2,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":557056
         },
         "libp2p.identify":{
            "Streams":32,
            "StreamsInbound":16,
            "StreamsOutbound":16,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":8912896
         },
         "libp2p.ping":{
            "Streams":4,
            "StreamsInbound":2,
            "StreamsOutbound":3,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":1114112
         },
         "libp2p.relay/v1":{
            "Streams":64,
            "StreamsInbound":64,
            "StreamsOutbound":64,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":17825792
         },
         "libp2p.relay/v2":{
            "Streams":64,
            "StreamsInbound":64,
            "StreamsOutbound":64,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":17825792
         }
      },
      "DefaultProtocolLimits":{
         "Streams":262144,
         "StreamsInbound":65536,
         "StreamsOutbound":262144,
         "Conns":0,
         "ConnsInbound":0,
         "ConnsOutbound":0,
         "FD":0,
         "Memory":67108864
      },
      "DefaultProtocolPeerLimits":{
         "Streams":512,
         "StreamsInbound":128,
         "StreamsOutbound":256,
         "Conns":0,
         "ConnsInbound":0,
         "ConnsOutbound":0,
         "FD":0,
         "Memory":33554432
      },
      "ProtocolLimits":{
         "/ipfs/id/1.0.0":{
            "Streams":262144,
            "StreamsInbound":65536,
            "StreamsOutbound":262144,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":33554432
         },
         "/ipfs/id/push/1.0.0":{
            "Streams":262144,
            "StreamsInbound":65536,
            "StreamsOutbound":262144,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":33554432
         },
         "/ipfs/ping/1.0.0":{
            "Streams":262144,
            "StreamsInbound":65536,
            "StreamsOutbound":262144,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "/libp2p/autonat/1.0.0":{
            "Streams":262144,
            "StreamsInbound":65536,
            "StreamsOutbound":262144,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "/libp2p/circuit/relay/0.1.0":{
            "Streams":1280,
            "StreamsInbound":1280,
            "StreamsOutbound":1280,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "/libp2p/circuit/relay/0.2.0/hop":{
            "Streams":1280,
            "StreamsInbound":1280,
            "StreamsOutbound":1280,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "/libp2p/circuit/relay/0.2.0/stop":{
            "Streams":1280,
            "StreamsInbound":1280,
            "StreamsOutbound":1280,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "/libp2p/dcutr":{
            "Streams":262144,
            "StreamsInbound":65536,
            "StreamsOutbound":262144,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":67108864
         },
         "/p2p/id/delta/1.0.0":{
            "Streams":262144,
            "StreamsInbound":65536,
            "StreamsOutbound":262144,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":33554432
         }
      },
      "ProtocolPeerLimits":{
         "/ipfs/id/1.0.0":{
            "Streams":32,
            "StreamsInbound":16,
            "StreamsOutbound":16,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":8912896
         },
         "/ipfs/id/push/1.0.0":{
            "Streams":32,
            "StreamsInbound":16,
            "StreamsOutbound":16,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":8912896
         },
         "/ipfs/ping/1.0.0":{
            "Streams":4,
            "StreamsInbound":2,
            "StreamsOutbound":3,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":1114112
         },
         "/libp2p/autonat/1.0.0":{
            "Streams":2,
            "StreamsInbound":2,
            "StreamsOutbound":2,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":557056
         },
         "/libp2p/circuit/relay/0.1.0":{
            "Streams":128,
            "StreamsInbound":128,
            "StreamsOutbound":128,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":35651584
         },
         "/libp2p/circuit/relay/0.2.0/hop":{
            "Streams":128,
            "StreamsInbound":128,
            "StreamsOutbound":128,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":35651584
         },
         "/libp2p/circuit/relay/0.2.0/stop":{
            "Streams":128,
            "StreamsInbound":128,
            "StreamsOutbound":128,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":35651584
         },
         "/libp2p/dcutr":{
            "Streams":2,
            "StreamsInbound":2,
            "StreamsOutbound":2,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":557056
         },
         "/p2p/id/delta/1.0.0":{
            "Streams":32,
            "StreamsInbound":16,
            "StreamsOutbound":16,
            "Conns":0,
            "ConnsInbound":0,
            "ConnsOutbound":0,
            "FD":0,
            "Memory":8912896
         }
      },
      "DefaultPeerLimits":{
         "Streams":1024,
         "StreamsInbound":512,
         "StreamsOutbound":1024,
         "Conns":16,
         "ConnsInbound":8,
         "ConnsOutbound":16,
         "FD":8,
         "Memory":67108864
      },
      "PeerLimits":null,
      "ConnLimits":{
         "Streams":0,
         "StreamsInbound":0,
         "StreamsOutbound":0,
         "Conns":1,
         "ConnsInbound":1,
         "ConnsOutbound":1,
         "FD":1,
         "Memory":1048576
      },
      "StreamLimits":{
         "Streams":1,
         "StreamsInbound":1,
         "StreamsOutbound":1,
         "Conns":0,
         "ConnsInbound":0,
         "ConnsOutbound":0,
         "FD":0,
         "Memory":16777216
      }
   }
}
{"Type":1,"Scope":"system","Limit":{"Streams":524288,"StreamsInbound":131072,"StreamsOutbound":524288,"Conns":32768,"ConnsInbound":16384,"ConnsOutbound":16384,"FD":16384,"Memory":4294967296}}
{"Type":1,"Scope":"transient","Limit":{"Streams":512,"StreamsInbound":128,"StreamsOutbound":512,"Conns":128,"ConnsInbound":32,"ConnsOutbound":128,"FD":128,"Memory":67108864}}
{"Type":1,"Scope":"conn-1","Limit":{"Streams":0,"StreamsInbound":0,"StreamsOutbound":0,"Conns":1,"ConnsInbound":1,"ConnsOutbound":1,"FD":1,"Memory":1048576}}
{"Type":9,"Scope":"transient","Delta":1,"DeltaIn":1,"ConnsIn":1,"FD":1}
{"Type":9,"Scope":"system","Delta":1,"DeltaIn":1,"ConnsIn":1,"FD":1}
{"Type":9,"Scope":"conn-1","Delta":1,"DeltaIn":1,"ConnsIn":1,"FD":1}
{"Type":1,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Limit":{"Streams":1024,"StreamsInbound":512,"StreamsOutbound":1024,"Conns":16,"ConnsInbound":8,"ConnsOutbound":16,"FD":8,"Memory":67108864}}
{"Type":3,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Priority":255}
{"Type":6,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":9,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Delta":1,"DeltaIn":1,"ConnsIn":1,"FD":1}
{"Type":5,"Scope":"transient"}
{"Type":8,"Scope":"transient"}
{"Type":11,"Scope":"transient","Delta":-1,"DeltaIn":-1}
{"Type":1,"Scope":"stream-1","Limit":{"Streams":1,"StreamsInbound":1,"StreamsOutbound":1,"Conns":0,"ConnsInbound":0,"ConnsOutbound":0,"FD":0,"Memory":16777216}}
{"Type":6,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaOut":1,"StreamsOut":1}
{"Type":6,"Scope":"transient","DeltaOut":1,"StreamsOut":1}
{"Type":6,"Scope":"system","DeltaOut":1,"StreamsOut":1}
{"Type":6,"Scope":"stream-1","DeltaOut":1,"StreamsOut":1}
{"Type":3,"Scope":"system","Priority":255,"Delta":262144,"Memory":262144}
{"Type":3,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Priority":255,"Delta":262144,"Memory":262144}
{"Type":1,"Scope":"protocol:/ipfs/id/1.0.0","Limit":{"Streams":262144,"StreamsInbound":65536,"StreamsOutbound":262144,"Conns":0,"ConnsInbound":0,"ConnsOutbound":0,"FD":0,"Memory":33554432}}
{"Type":3,"Scope":"protocol:/ipfs/id/1.0.0","Priority":255}
{"Type":6,"Scope":"protocol:/ipfs/id/1.0.0","DeltaOut":1,"StreamsOut":1}
{"Type":9,"Scope":"protocol:/ipfs/id/1.0.0"}
{"Type":1,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Limit":{"Streams":32,"StreamsInbound":16,"StreamsOutbound":16,"Conns":0,"ConnsInbound":0,"ConnsOutbound":0,"FD":0,"Memory":8912896}}
{"Type":3,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Priority":255}
{"Type":6,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaOut":1,"StreamsOut":1}
{"Type":9,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":5,"Scope":"transient"}
{"Type":8,"Scope":"transient","DeltaOut":-1}
{"Type":11,"Scope":"transient"}
{"Type":3,"Scope":"system","Priority":255,"Delta":262144,"Memory":524288}
{"Type":3,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Priority":255,"Delta":262144,"Memory":524288}
{"Type":1,"Scope":"stream-2","Limit":{"Streams":1,"StreamsInbound":1,"StreamsOutbound":1,"Conns":0,"ConnsInbound":0,"ConnsOutbound":0,"FD":0,"Memory":16777216}}
{"Type":6,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":1,"StreamsIn":1,"StreamsOut":1}
{"Type":6,"Scope":"transient","DeltaIn":1,"StreamsIn":1}
{"Type":6,"Scope":"system","DeltaIn":1,"StreamsIn":1,"StreamsOut":1}
{"Type":6,"Scope":"stream-2","DeltaIn":1,"StreamsIn":1}
{"Type":3,"Scope":"system","Priority":255,"Delta":262144,"Memory":786432}
{"Type":3,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Priority":255,"Delta":262144,"Memory":786432}
{"Type":1,"Scope":"stream-3","Limit":{"Streams":1,"StreamsInbound":1,"StreamsOutbound":1,"Conns":0,"ConnsInbound":0,"ConnsOutbound":0,"FD":0,"Memory":16777216}}
{"Type":6,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":1,"StreamsIn":2,"StreamsOut":1}
{"Type":6,"Scope":"transient","DeltaIn":1,"StreamsIn":2}
{"Type":6,"Scope":"system","DeltaIn":1,"StreamsIn":2,"StreamsOut":1}
{"Type":6,"Scope":"stream-3","DeltaIn":1,"StreamsIn":1}
{"Type":3,"Scope":"protocol:/ipfs/id/1.0.0","Priority":255}
{"Type":6,"Scope":"protocol:/ipfs/id/1.0.0","DeltaIn":1,"StreamsIn":1,"StreamsOut":1}
{"Type":9,"Scope":"protocol:/ipfs/id/1.0.0"}
{"Type":3,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Priority":255}
{"Type":6,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":1,"StreamsIn":1,"StreamsOut":1}
{"Type":9,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":5,"Scope":"transient"}
{"Type":8,"Scope":"transient","DeltaIn":-1,"StreamsIn":1}
{"Type":11,"Scope":"transient"}
{"Type":1,"Scope":"service:libp2p.identify","Limit":{"Streams":256,"StreamsInbound":128,"StreamsOutbound":128,"Conns":0,"ConnsInbound":0,"ConnsOutbound":0,"FD":0,"Memory":67108864}}
{"Type":3,"Scope":"service:libp2p.identify","Priority":255}
{"Type":6,"Scope":"service:libp2p.identify","DeltaIn":1,"StreamsIn":1}
{"Type":9,"Scope":"service:libp2p.identify"}
{"Type":1,"Scope":"libp2p.identify.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Limit":{"Streams":32,"StreamsInbound":16,"StreamsOutbound":16,"Conns":0,"ConnsInbound":0,"ConnsOutbound":0,"FD":0,"Memory":8912896}}
{"Type":3,"Scope":"libp2p.identify.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Priority":255}
{"Type":6,"Scope":"libp2p.identify.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":1,"StreamsIn":1}
{"Type":9,"Scope":"libp2p.identify.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":5,"Scope":"system","Delta":-262144,"Memory":524288}
{"Type":5,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Delta":-262144,"Memory":524288}
{"Type":5,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Memory":524288}
{"Type":8,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":-1,"StreamsIn":1,"StreamsOut":1}
{"Type":11,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","ConnsIn":1,"FD":1}
{"Type":5,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":8,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":-1,"StreamsOut":1}
{"Type":11,"Scope":"protocol:/ipfs/id/1.0.0.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":5,"Scope":"libp2p.identify.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":8,"Scope":"libp2p.identify.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":-1}
{"Type":11,"Scope":"libp2p.identify.peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3"}
{"Type":5,"Scope":"protocol:/ipfs/id/1.0.0"}
{"Type":8,"Scope":"protocol:/ipfs/id/1.0.0","DeltaIn":-1,"StreamsOut":1}
{"Type":11,"Scope":"protocol:/ipfs/id/1.0.0"}
{"Type":5,"Scope":"service:libp2p.identify"}
{"Type":8,"Scope":"service:libp2p.identify","DeltaIn":-1}
{"Type":11,"Scope":"service:libp2p.identify"}
{"Type":5,"Scope":"system","Memory":524288}
{"Type":8,"Scope":"system","DeltaIn":-1,"StreamsIn":1,"StreamsOut":1}
{"Type":11,"Scope":"system","ConnsIn":1,"FD":1}
{"Type":2,"Scope":"stream-2"}
{"Type":1,"Scope":"conn-2","Limit":{"Streams":0,"StreamsInbound":0,"StreamsOutbound":0,"Conns":1,"ConnsInbound":1,"ConnsOutbound":1,"FD":1,"Memory":1048576}}
{"Type":9,"Scope":"transient","Delta":1,"DeltaIn":1,"ConnsIn":1,"FD":1}
{"Type":9,"Scope":"system","Delta":1,"DeltaIn":1,"ConnsIn":2,"FD":2}
{"Type":9,"Scope":"conn-2","Delta":1,"DeltaIn":1,"ConnsIn":1,"FD":1}
{"Type":1,"Scope":"conn-3","Limit":{"Streams":0,"StreamsInbound":0,"StreamsOutbound":0,"Conns":1,"ConnsInbound":1,"ConnsOutbound":1,"FD":1,"Memory":1048576}}
{"Type":9,"Scope":"transient","Delta":1,"DeltaIn":1,"ConnsIn":2,"FD":2}
{"Type":9,"Scope":"system","Delta":1,"DeltaIn":1,"ConnsIn":3,"FD":3}
{"Type":9,"Scope":"conn-3","Delta":1,"DeltaIn":1,"ConnsIn":1,"FD":1}
{"Type":5,"Scope":"system","Delta":-262144,"Memory":262144}
{"Type":5,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Delta":-262144,"Memory":262144}
{"Type":5,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","Memory":262144}
{"Type":8,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","DeltaIn":-1,"StreamsOut":1}
{"Type":11,"Scope":"peer:12D3KooWBP5Yi9v1swwG7cMvfByx5Q5U5ZwaANSvybZ9SciMUpv3","ConnsIn":1,"FD":1}
{"Type":5,"Scope":"transient"}
{"Type":8,"Scope":"transient","DeltaIn":-1}
{"Type":11,"Scope":"transient","ConnsIn":2,"FD":2}

@BigLep
Copy link
Contributor Author

BigLep commented Jun 3, 2022

Upon discussion 2022-06-03, rather than relying on trace files, we think it's a better to move the metrics story (libp2p/go-libp2p#1356 ) forward.

Basically, use Prometheus to capturing metrics around all the things an operator cares about. This then makes it easy to:

  1. Have a script that queries Prometheus to get all the metrics, determine the "max" value for various scopes, apply a scaling factor, and output suggested limit config.
  2. Render graphs in Grafana for showing the consumption of each resource scope. This allows an operator to spot check a given scope visually. For example, a scope that is continually climbing over time is indicative of a resource leak and will have problems if a limit is set close to the value from that snapshot in time.

@BigLep
Copy link
Contributor Author

BigLep commented Jun 3, 2022

Also per 2022-06-03, we're going to focus on getting alignment on the desired end state here before doing more implementation work. We'll draft up the limits we'd ideally like this guide/script to generate. We can then match that up against what's possible.

@marten-seemann
Copy link
Contributor

Minimum goal: get a limiter configuration that would have allowed all the activity that happened, but not more.

Nice to have (but not necessarily built by us): Give users the option to analyse / visualise the data further, to make informed modifications to that limiter config.

@BigLep
Copy link
Contributor Author

BigLep commented Jul 23, 2022

I believe we've mostly turned to handling this with updated readme: https://github.com/libp2p/go-libp2p-resource-manager/blob/master/README.md (as done in #59)

There are other updates to the readme we need to do though per #68

@marten-seemann
Copy link
Contributor

This issue has been resolved by our various docs updates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants