Ns driver

From AOLserver Wiki
Jump to navigation Jump to search

NAME

ns_driver - Enumerate socket drivers, open waiting sockets and get some socket driver stats (new in AOLserver 4.5)

SYNOPSIS

ns_driver list
ns_driver query driverInstance

DESCRIPTION

This command provides a way to examine the current socket driver stats and open waiting sockets.
  • ns_driver list
Returns a list of socket driver instances in this process which are names of the form virtualservername/module (i.e. myserver/nssock, myserver/nssock2, anotherserver/nsopenssl, etc.)
  • ns_driver query driverInstance
Returns a map with two keys - stats and socks.
The value of stats is itself a map of stats for the driver instance since server startup like this:
   time 1276409140:562735 spins 4078 accepts 192 queued 1251 reads 18034 dropped 0 overflow 0 timeout 0
where time is the current time in ns_time get format, spins is the number of poll()s performed, accepts is the number of accepted NEW sockets, queued is the number of connections handed off to connection processing, reads is the number of read buffers, dropped is the number of connections dropped while waiting to be queued, overflow is the number of connections that exceeded an ns_limits limit and timeout is the number of connections that timed out while waiting as per the ns_limits limits and timeout settings.
The value of socks is a list of open waiting sockets, where each element is a map but with an additional subelement (without a key) at the end, which is a 7-element list in ns_server all format, except the state will always be "i/o", url and method will be "?", bytes sent will be 0 and what is supposed to be the running time in seconds.microseconds is instead the accept timestamp.
   id 55370218 sock 8432 state readwait idx 22 events 768 revents 768 accept 1276407692:663325 timeout 1276407992:663325 {55370221 124.217.238.150 i/o ? ? 1276407692.663325 0}
Most of the socks information is only useful for driver debugging purposes with various internal ids and pollfd flags which are platform specific. For administering a server, the overall number of sockets in readwait (prior to connection processing) and closewait (after connection processing) states is useful. Note that only sockets that have not yet been handed over to the connection pool or sockets that have come back from a connection thread show up in this list.

-