Difference between revisions of "Ns server"

From AOLserver Wiki
Jump to navigation Jump to search
Line 13: Line 13:
 
'''DESCRIPTION'''
 
'''DESCRIPTION'''
  
: This command provides a way to examine the current server's connection pools and queues.  The legal ''option''s (which may be abbreviated) are:
+
: This command provides a way to examine the current server's connection pools and queues. In AOLserver 4.0, if the optional pool name is omitted, data is returned for the "unnamed" connection pool for this virtual serverIn AOLserver 4.5, the pool named "default" will be used.  In AOLserver 4.5 connection pools are shared by all virtual servers.
 +
 
 +
: The legal ''option''s (which may be abbreviated) are:
 
* '''ns_server active''' ''?pool?''
 
* '''ns_server active''' ''?pool?''
 
* '''ns_server all''' ''?pool?''
 
* '''ns_server all''' ''?pool?''
 
* '''ns_server queued''' ''?pool?''
 
* '''ns_server queued''' ''?pool?''
: The above three options return a list of just active (i.e. running), all or just queued conn threads with each running thread a 7-element list of {conn id, peeraddr, "running", method, url, running time, bytes sent}  
+
: The above three options return a list of just active (i.e. running), all, or just queued conn threads with each running thread a 7-element list of {conn id, peeraddr, "running", method, url, running time, bytes sent}.
 +
:: Note that running time is returned in seconds.microseconds format which is misleading because 0.100 does not mean a tenth of a second, it means 100 microseconds.
  
 
* '''ns_server connections''' ''?pool?''
 
* '''ns_server connections''' ''?pool?''
 
* '''ns_server keepalive''' ''?pool?''
 
* '''ns_server keepalive''' ''?pool?''
 +
: currently unimplemented, always returns 0, is presumably meant to return the number of connections in keepalive state
 
* '''ns_server pools''' ''?pool?''
 
* '''ns_server pools''' ''?pool?''
  
 +
: returns the list of pools defined for this virtual server in AOLserver 4.0 and this process in AOLserver 4.5.  If no user pools are defined, returns {} in 4.0 and "default error" in 4.5
 
* '''ns_server threads''' ''?pool?''
 
* '''ns_server threads''' ''?pool?''
  
: Returns a list of key-value pairs identifying the number of connection threads and what state they are currently in.
+
: returns a list of key-value pairs identifying the number of connection threads and what state they are currently in.
 
* '''ns_server waiting''' ''?pool?''
 
* '''ns_server waiting''' ''?pool?''
 +
 +
: returns the number of connections waiting to be processed
  
 
'''NOTES'''
 
'''NOTES'''

Revision as of 04:08, 4 October 2009

Man page: http://aolserver.com/docs/tcl/ns_server.html


NAME

ns_server - Get state of the server's connection pools and queues

SYNOPSIS

ns_server option ?pool?

DESCRIPTION

This command provides a way to examine the current server's connection pools and queues. In AOLserver 4.0, if the optional pool name is omitted, data is returned for the "unnamed" connection pool for this virtual server. In AOLserver 4.5, the pool named "default" will be used. In AOLserver 4.5 connection pools are shared by all virtual servers.
The legal options (which may be abbreviated) are:
  • ns_server active ?pool?
  • ns_server all ?pool?
  • ns_server queued ?pool?
The above three options return a list of just active (i.e. running), all, or just queued conn threads with each running thread a 7-element list of {conn id, peeraddr, "running", method, url, running time, bytes sent}.
Note that running time is returned in seconds.microseconds format which is misleading because 0.100 does not mean a tenth of a second, it means 100 microseconds.
  • ns_server connections ?pool?
  • ns_server keepalive ?pool?
currently unimplemented, always returns 0, is presumably meant to return the number of connections in keepalive state
  • ns_server pools ?pool?
returns the list of pools defined for this virtual server in AOLserver 4.0 and this process in AOLserver 4.5. If no user pools are defined, returns {} in 4.0 and "default error" in 4.5
  • ns_server threads ?pool?
returns a list of key-value pairs identifying the number of connection threads and what state they are currently in.
  • ns_server waiting ?pool?
returns the number of connections waiting to be processed

NOTES

See Bug #745784 -- ns_server is not safe under load because: "The problem is either the connPtr or some of the data buried in the conn can be changing in the running connection thread. I wouldn't suggest this be fixed because it could complicate the code and introduce a performance problem."
In AOLserver 4.5, a thread race condition which could lead to a crash when using "ns_server threads" has been fixed.


EXAMPLES

   % ns_server threads
   {min 0} {max 10} {current 0} {idle 0} {stopping 0}
   % ns_server all
   {3536 192.168.0.1 running GET /_stats 0.15624 0}

SEE ALSO


-