siris icon indicating copy to clipboard operation
siris copied to clipboard

Allow support for a LimitListener

Open theodesp opened this issue 8 years ago • 5 comments

Note: for support questions, please use our gitter channel or stackoverflow. This repository's issues are reserved for feature requests and bug reports.

  • **I'm submitting a ... **

    • [ ] bug report
    • [x] feature request
    • [ ] support request => Please do not submit support request here, see note at the top of this template.
  • Do you want to request a feature or report a bug? Feature

  • What is the current behavior? No limit of the server listener connections

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • What is the expected behavior? I Propose to add a limit listener that will restrict the amount of active connections in the server

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

  • Library version: v7.3.4

  • Operating System: [Darwin Kernel Version 10.2.0 | Microsoft Windows [Version 10.0.10240]]

  • System Information: [Core i7-7740X 16gb Ram]

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) I've taken the inspiration from https://github.com/tylerb/graceful/blob/master/limit_listen.go

wher you can wrap the net.Listener struct to accept a limit so we have a bounded number of active connections per server.

theodesp avatar Jul 20 '17 12:07 theodesp

Are you able to implement it with test and coverage?

Dexus avatar Jul 20 '17 12:07 Dexus

I will work on this weekend

theodesp avatar Jul 20 '17 13:07 theodesp

I would like to also enhance the ticket scope by providing options for:

  1. Limiting the Server connections in a global way
  2. Limiting the Server connections from a particular client.ip, request.host or request.header.X-Header
  3. Expose options from a config file
  4. On connection limit, we should respond with https://httpstatuses.com/429
  5. Middleware support.

theodesp avatar Jul 21 '17 12:07 theodesp

I like it. I'm looking forward to testing it.

Dexus avatar Jul 21 '17 12:07 Dexus

@theodesp any update?

Dexus avatar Sep 06 '17 15:09 Dexus