NaviServer Programmable Web Server

ns_driver(n)

NaviServer Built-in Commands – 5.1.0


[ Main Table Of Contents | Table Of Contents | Keyword Index ]

Name

ns_driver - Obtain Network Driver Information.

Table Of Contents

Synopsis

Description

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.

COMMANDS

ns_driver info ?-server server?

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.

ns_driver names ?-server server?

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.

ns_driver stats ?-server 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 accepted connections or requests seen by the driver.

  • spooled: the number of requests handed to an upload spooler.

  • partial: the number of partial receive operations, typically for requests that required multiple receive operations before enough input was available.

  • errors: the number of driver-level errors.

The current gauges are:

  • waiting: sockets currently on the driver thread's retry list, waiting for another attempt to queue the request into the selected connection pool.

  • reading: sockets currently on the driver thread's read or keepalive-wait list.

  • closing: sockets currently on the driver thread's close-wait list.

These gauges describe the current state of the driver thread and are intended for overload and shutdown diagnostics. They are not cumulative counters.

ns_driver threads ?-server server?

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.

See Also

ns_info, ns_server

Keywords

SO_REUSEPORT, address, configuration, driver, network driver, nssock, server built-in, socket