javabacklog

What is the corresponding value of the system default backlog value at java http server?


https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html

backlog - the socket backlog. If this value is less than or equal to zero, then a system default value is used.

what is corresponding valueof system default value?


Solution

  • It is operating system dependent. And for some operating systems, it is a setting that can be configured by the system administrators.

    For example, man 2 listen for Linux says:

    Since Linux 5.4, the default in this file is 4096; in earlier kernels, the default value is 128. In kernels before 2.4.25, this limit was a hard coded value, SOMAXCONN, with the value 128.

    By contrast, on Windows the description of the backlog parameter says:

    The maximum length of the queue of pending connections. If set to SOMAXCONN, the underlying service provider responsible for sockets will set the backlog to a maximum reasonable value.