python实现网速控制,限制上传下载速度

  对于python的web,比如flask使用的werkzeug,首先找到wsgi的请求和响应的代码,使用算法实现大文件的小速率上传和下载

  考虑python实现socket限流

  关于限速的讨论:https://www.v2ex.com/t/142992

  前端限速:比如浏览器就可以模拟各类速度;https://github.com/tjgq/node-stream-throttle;https://keelii.github.io/2016/06/11/javascript-throttle/

  服务器限速:利用tcp滑动窗口和tcp的拥塞算法

  网关nginx限流:可以限制访问频率和数据传输速度。http://nginx.org/en/docs/http/ngx_http_limit_req_module.html;http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html

 

你可能感兴趣的