Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conf, router: Make the listen(2) backlog configurable #1388

Merged
merged 1 commit into from
Aug 19, 2024

Commits on Aug 19, 2024

  1. conf, router: Make the listen(2) backlog configurable

    @oopsoop2 on GitHub reported a performance issue related to the default
    listen(2) backlog size of 511 on nginx. They found that increasing it
    helped, nginx has a config option to configure this.
    
    They would like to be able to do the same on Unit (which also defaults
    to 511 on some systems). This seems reasonable.
    
    NOTE: On Linux before commit 97c15fa ("socket: Use a default listen
    backlog of -1 on Linux") we defaulted to 511. Since that commit we
    default to the Kernels default, which before 5.4 is 128 and after is
    4096.
    
    This adds a new per-listener 'backlog' config option, e.g
    
      {
          "listeners": {
              "[::1]:8080": {
                  "pass": "routes",
                  "backlog": 1024
              },
          }
    
          ...
      }
    
    This doesn't effect the control socket.
    
    Closes: nginx#1384
    Reported-by: <https://github.com/oopsoop2>
    Signed-off-by: Andrew Clayton <[email protected]>
    ac000 committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    76489fb View commit details
    Browse the repository at this point in the history