linux - How to limit file download speed?
欧阳克
欧阳克 2017-06-27 09:18:22
0
1
1212

There is now afile download serverofHTTP, which has currently limited the download speed ofsingle thread. The speed is200kb/sbut if the user usesmulti-threadingto download, such as Thunder. You can break through the limitations and achieve double the effect. May I ask howcentoscan limit the speed above?

欧阳克
欧阳克

温故而知新,可以为师矣。 博客:www.ouyangke.com

reply all (1)
曾经蜡笔没有小新

You can use nginx’s limit_conn_module to limit the number of client IP connections.
The following is a simplified configuration:

http { limit_conn_zone $binary_remote_addr zone=addr:10m; server { limit_conn addr 1; } }
  • limit_conn_zoneDefine a bucket that limits connections;

  • $binary_remote_addrmeans to calculate the number of connections based on the client IP as the key;

  • zone=addrDeclare the name of this bucket;

  • limit_connexecutes a limit on the number of connections, and the followingaddris to call the previously configured bucket.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!