Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Proposal: a raw method to realize dynamical rate limiting  #1427

@zhaxzhax

Description

@zhaxzhax

A raw method to realize dynamical rate limiting

It's just the raw version of my future implementation, maybe rough, but could still be optimizing later.

My implementation plan

  1. Add {weight、rateLimiter} in PeerMgr struct
  2. Design a schedule algorithm that will optimize the process that one PeerNode download from a high weight level PeerNode, also maintains weight in PeerMgr struct. (As the picture below)
    image
  3. Write a program to listen host total bandwidth(HTB Listener)
  4. Design a algorithm dynamically adjust the host rateLimiter, and send it to SuperNodePeer.(The flow chart and the algorithm are as below)
    image
    image
  5. Add cli option to determine whether to open dynamically rateLimiter.
  6. Benchmark and optimization.

Additional information

  • There is ProducerLoad in progress_manager, may be we should using ProducerLoad instead of weight and add rateLimiter in each progress_manager.
  • We could use gopacket to listen host local bandwidth.
  • The dynamical rate algorithem may be too rough, TCP Congestion Control Algorithm could be a better method to imitate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions