GithubHelp home page GithubHelp logo

limit_upload_rate's Introduction

#README# ngx_limit_upload_module is a tengine module, which allows you to limit client-upload rate when they are sending request bodies to you. the usage is just the same as limit_rate functionality of stardard nginx. If you want to use it with nginx, see Chapter "USE WITH NGINX" for details.

##Directive##

###limit_upload_rate rate###

Syntax:    limit_upload_rate rate;
Default:   limit_upload_rate 0;
Context:   http, server, location, if in location

Rate limits the transmission of request body from a client. The rate is specified in bytes per second. The value 0 disables rate limiting. The limit is set per request, so if a client simultaneously opens two connections, an overall rate will be twice as much as the specified limit.

Rate limit can also be set in the $limit_upload_rate variable. It may be useful in cases where rate should be limited depending on a certain condition:

server {

    if ($slow) {
        set $limit_rate 4k;
    }

    ...
}

###limit_upload_rate_after###

Syntax:     limit_upload_rate_after size;
Default:    limit_upload_rate_after 0;
Context:    http, server, location, if in location

Sets the initial amount after which the further transmission of a request body from a client will be rate limited.

##USE WITH TENGINE## the module needs the latest input body filter in tengine, otherwise the functionality of this module is totally unavailable. the update can be found at https://github.com/taobao/tengine/pull/136

./configure --add-module=limit_upload_rate
make

##USE WITH NGINX## the module needs the latest input body filter in tengine, so you have to patch nginx if you want to use this module. the patch file is included with the filename "for-nginx.patch" and is verified under nginx 1.2.5. for-nginx-1.4.4.patch is base on nginx 1.4.4 and can be used with nginx 1.5.X

patch -p1 < for-nginx-1.4.4.patch
./configure --add-module=limit_upload_rate
make

##CHANGES## 1.0.1 2012-12-24 bugfix: conflict with "client_body_timeout" 1.0.0 2012-12-07 initial version

limit_upload_rate's People

Contributors

cfsego avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.