Restrict download file bandwidth/speed in Servlet

后端 未结 2 985
小鲜肉
小鲜肉 2020-12-15 12:27

we got high-load java application which works in clustered mode.

I need to add ability to download and upload files for our customers. For storing files i\'m going

2条回答
  •  旧巷少年郎
    2020-12-15 12:58

    Leaky bucket or token bucket algorithms can be used to control the network bandwidth.

    EDIT: I did some quick prototyping and implemented the algorithm leveraging Servlet 3.0 asynchronous processing. Results are pretty good. Full source code can be found on GitHub. Have fun!

提交回复
热议问题