NaviServer Built-in Commands – 5.1.1
ns_driver - Obtain Network Driver Information.
The command ns_driver allows one to obtain information about the loaded network drivers, their configuration and their usage.
In general, one NaviServer process might have multiple network driver modules loaded. Every driver module has a type (such as e.g. "nssock" for HTTP connections or "nsssl" for HTTPS) and a name, where the type of the driver module is often used for its name as well. However, when a driver module of a certain type is loaded multiple times (e.g. listening at different addresses or ports) every driver module instance must have a distinct name.
Consult the NaviServer Configuration Reference and the documentation of the nssock network driver for detailed configuration options of the network drivers.
Returns a list containing information of all loaded network drivers. The option -server can be used to return only drivers registered for this server.
Every outer list element describes a different network driver module instance. For every driver module instance the following information elements are returned:
module refers to the name of the driver module, such as e.g. "nssock"
type refers to the type of the driver module, such as e.g. "nssock"
server is the associated server, if this module is loaded for a certain server; for global drivers, the value is empty.
location is the location as derived from the configuration data, might be e.g. "http://localhost:8091"
address is the space separated list of IP addresses (IPv4 or IPv6), on which the driver is listening, might be e.g. "0.0.0.0"
port space separated list of ports, on which the driver listens
defaultport the default port for this driver
protocol is the name of the protocol, such as e.g. "http"
sendwait timeout for send operations.
recvwait timeout for receive operations.
extraheaders are the extra response header fields to be returned on every request via this driver.
libraryversion version number of the library implemented major parts of the communication.
Returns a list of the names of all currently loaded driver modules. By default, every driver that has been loaded into the server process is included in the result. The -server option restricts the output to drivers that are registered for the given server.
Returns driver statistics for every loaded driver. The -server option restricts the output to drivers that are registered for the given server.
The result is a list containing one dictionary-style list per matching driver. Each entry includes the driver thread name and driver module name, followed by cumulative counters and current driver-thread gauges. The cumulative counters are:
received: the number of attempts by the driver to submit a parsed request to a connection pool. Normally this is incremented once per request. A request retained on the driver's waiting list can cause additional increments when assignment is retried.
spooled: the number of requests handed to an upload spooler.
partial: the number of receive attempts that did not yet provide enough input to complete the request. Such a result retains the socket on the driver's reading list. This counter can be incremented multiple times for one request.
errors: the number of driver-level errors.
The current gauges are:
waiting: parsed requests retained by the driver because they could not yet be assigned an Ns_Conn structure in the selected connection pool. The driver retries the assignment later.
reading: sockets retained on the driver's read/keep-alive wait list. These are either incomplete requests waiting for more input or keep-alive connections waiting for the next request.
closing: sockets retained temporarily for graceful connection shutdown, normally until the peer closes or the configured close-wait timeout expires.
These gauges describe the current state of the driver thread and are intended for overload and shutdown diagnostics. They are not cumulative counters.
Returns a list of the names of the driver threads. The -server option restricts the output to drivers that are registered for the given server.