nssock - Configuring http socket communications
This module nssock is used for the socket communication for http. For the communication via https, the module nsssl is used, which shares the configuration parameters presented here and adds additional parameters.
The module nssock is typically loaded per server, e.g. for server1:
ns_section ns/server/server1/modules ns_param nssock nssock.so ns_section ns/server/server1/module/nssock ns_param port 8000 ...
This amount of configuration is sufficient for many installations, which do not want to run the server on port 80 (which requires as well root permissions for starting).
The module nssock provides a rich set of configuration options, which are important for large installation. However, all parameters are equipped with sensible default values, such that none of these are required.
Maximum number of requests accepted at once (integer, defaults to the value backlog)
IP-Address on which the server should listen (default: 0.0.0.0)
Maximum number of entries for waiting listen connections (integer, default: 256)
Maximum size in bytes (octets) for a single receive operation (integer, 16384)
Timeout in seconds for close on socket to drain potential garbage if no keep alive is performed. (integer, default: 2)
When virtual servers are defined, this refers to the default server (the server, receiving all urls not mapped to a specific server)
TCP Performance option; use TCP_FASTOPEN or TCP_DEFER_ACCEPT or SO_ACCEPTFILTER, whatever is available in your operating system to improve the performance of the initial TCP 3-way handshake. The capabilities of the operating system are determined at compile time. If you want to use TCP_FASTOPEN (introduced by Linux kernel 3.7.0), you might have to activate this option in your kernel, by using
sudo sysctl net.ipv4.tcp_fastopen=1
(boolean, default: false)
Hostname of the server, can be looked up automatically if not specified.
Don't allow keep-alive for downloads content larger than this size in bytes; a value of 0 means that this feature is deactivated (integer, default 0)
Don't allow keep-alive for upload content larger than this size in bytes; a value of 0 means that this feature is deactivated (integer, default 0)
Timeout in seconds for keep-alive. (integer, default: 5)
Provide a default for protocol://hostname[:port]. Useful for virtual servers.
Maximum number of header lines (integer, 128)
Maximum size in bytes (octets) for content loaded into the server, such as upload of files. (integer, default: 1048576)
Maximum size in bytes (octets) of a single header line (integer, default: 8192)
Size of the queue of accepted requests waiting for a connection thread (integer, default 1024).
When spooler threads are activated, use spooler threads for uploads larger than this size in bytes (see as well spoolerthreads)
TCP Performance option; use TCP_NODELAY (OS-default on Linux). (boolean, default: false)
Port, on which the server listens. When the port is specified as 0, the module with its defined commands (such as ns_http is loaded, but the driver will not be listening on any port. (integer, default: 80)
This parameter can be used to add extra response headers for every reponse sent over this driver. The extraheaders have the form for attribute/value pairs. This mechanism can be used to implement for example HTTP Strict Transport Security in nsssl, which uses the same parameter definition.
Maximum size in bytes (octets) for asynchronous read ahead operations (integer, defaults to bufsize)
Timeout in seconds for receive operations. (integer, default: 30)
Timeout in seconds for send operations. (integer, default: 30)
Number of spooler threads, which spool uploads to a file rather than to memory; see as well maxupload (integer, default: 0)
Directory for uploads, defaults to the setting of ns/parameter tmpdir.
Buffer size in bytes (octets) for writer threads (integer, default: 8192)
Use writer threads for replies above this size. (integer, default: 1048576)
Use writer threads for streaming HTML output (e.g. ns_write ...). (boolean, default: false)
Number of writer threads. (integer, default: 0)
In case, one requires for one naviserver to listen on several ports, it is possible to load the nssock module twice with different names, here nssock1 and nssock2.
ns_section ns/server/server1/modules ns_param nssock1 nssock.so ns_param nssock2 nssock.so ns_section ns/server/server1/module/nssock1 ns_param port 8000 ns_section ns/server/server1/module/nssock2 ns_param port 8001
More to come here...