freenet-core
freenet-core copied to clipboard
Peer resource usage balancing
- Peers track CPU and bandwidth usage, attributing it either to the peer's user, or to other peers
- eg. Peer A sends request to peer B, peer B keeps track of all CPU/bw usage as a result of this request and attributes it to peer A
- This includes "downstream" resource usage, anything this peer asks other peers to do
- This means that every response to a request must include an accounting of downstream resources used to answer the request
- A peer has a user-configurable maximum CPU and upstream/downstream usage limit
- Peers can request that other peers throttle requests by requiring a minimum time between requests
- Another peer that violates this request will be disconnected
- A peer maintains a global minimum request interval, which is determined using an isotonic regression to avoid exceeding the user-configurable CPU/bw limits
Related
- While this mechanism tracks and managed resource usage per-peer, #244 describes a parallel mechanism that tracks and manages resource usage per-contract
@sanity if you want leave any details in this issue about the conversation we had last week regarding automatically optimizing for max value (where we would define value as per some sort of processing rate - processing cost) so they don't get lost.
Relevant if we need fine-grained tracking of memory allocations: https://www.reddit.com/r/rust/comments/jfliht/how_to_detect_memory_allocations/g9l2ex4/
Pivotal Tracker story: https://www.pivotaltracker.com/story/show/184207088