Giter Club home page Giter Club logo

Comments (3)

shepmaster avatar shepmaster commented on September 3, 2024

See also #10

from tower-web.

carllerche avatar carllerche commented on September 3, 2024
  • request header read timeout: max time it can take for the client to send all headers
  • idle timeout for keepalive sessions

These would need to go in hyper. I would check to see if it is already possible.

  • request body timeout
  • request reply timeout (if a client simply doesn't read the reply)
  • max number of simultaneous requests per client (source ip address)
  • max number of requests/sec per client

Implemented as a middleware. It can start in this repo and eventually be moved into tower-http.

  • if there was a way to get the client's IP address

Can be discussed in #71

  • there should be a way for a request handler to reset/restart the timeouts, e.g. to facilitate large bodies or large replies.

You will have to elaborate more on this one.

If you want to take a stab at any of these items, I can help with some pointers.

from tower-web.

miquels avatar miquels commented on September 3, 2024

there should be a way for a request handler to reset/restart the timeouts, e.g. to facilitate large bodies or large replies.

You will have to elaborate more on this one.

For example, when you set a request body timeout of 30 seconds, and after the timeout it turns out that 30 MB of body payload already has been received - in that case, yes, 30 seconds have passed, but progress is made, so you want to ignore this timeout and set a new one.

Either this, or 2 seperate types of timeout: absolute, with a hard limit (N minutes no matter what) and relative, one that fires if no progress is made (connection stalled) for a certain period of time.

If it is possible to implement this as middleware, even better, because that would allow more complicated strategies as well (say when max. number of clients is reached, close the oldest sessions that are idling in keepalive).

For completeness, a list of nginx's timeouts.

from tower-web.

Related Issues (20)

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.